Remove timestamp from output of mip_friendly_messages.pck

Add constraint to regi_enqu_exclusions to prevent both enquiry and additional items being recorded on the same row.

Allow schema to be passed to apex_auto_install.rb.

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3666 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
hardya
2008-02-21 17:56:52 +00:00
parent e15c3787ac
commit aab27144a0
11 changed files with 315 additions and 277 deletions

View File

@@ -1,18 +1,18 @@
#requires
# #requires
require 'watir'
#email stuff
# #email stuff
require 'net/smtp'
#used to handle javascript popups
# #used to handle javascript popups
require 'watir/contrib/enabled_popup'
require 'watir/WindowHelper'
#
#
# Method to handle javascript popups.
#
#
require 'thread'
#
#
require 'win32ole'
#
#
def startClicker( button , waitTime = 3)
w = WinClicker.new
longName = @@ie.dir.gsub("/" , "\\" )
@@ -26,32 +26,43 @@ end
#includes
# #includes
include Watir
@@ie = IE.new
@@ie.visible= false
#set the speed of watir
@@ie.visible= true
# #set the speed of watir
@@ie.speed = :fast
#backup 2 directories
# #backup 2 directories
Dir.chdir('..')
Dir.chdir('..')
#we're in windows, so replace the forwards with the backs
# #we're in windows, so replace the forwards with the backs
workingdir = Dir.getwd.to_s.gsub!('/','\\')
#Set constants for import
# #Set constants for import
ORIGINAL_APP_ID = '155'
NEW_APP_ID = '102'
SCHEMA = 'MIP_TEST'
SCHEMA = ARGV[0].upcase if ARGV[0]
SCHEMA = 'MIP_TEST' if !ARGV[0]
APEX_EXPORT_SCRIPTS_DIR = workingdir +'\\Screens\\'
APPLICATION_SCRIPT = 'f155.sql'
CSS_SCRIPT = 'css.sql'
IMAGES_SCRIPT = 'f155_img.sql'
THEME_SCRIPT = 'f155_theme_101.sql'
ADID = '4550' #APEX admin identifier
WORKSPACE = 'MIP_TEST'
WORKSPACE = ARGV[1].upcase if ARGV[1]
WORKSPACE = 'MIP_TEST' if !ARGV[1]
USER = 'ADMIN'
PASSWORD = 'password'
DELETE_PREVIOUS_IMPORTS = false
#
def login(p_workspace, p_user, p_password)
@@ie.goto("http://loordv01/pls/apex/f?p=#{ADID}:1")
@@ie.text_field(:id, "F#{ADID}_P1_COMPANY").set(p_workspace)
@@ie.text_field(:id, "F#{ADID}_P1_USERNAME").set(p_user)
@@ie.text_field(:id, "F#{ADID}_P1_PASSWORD").set(p_password)
@@ie.button(:value, 'Login').click
@@ie.wait
end
def importpageone (p_file, p_file_type, p_charset)
@@ie.link(:title, 'Application Builder').click
@@ie.wait
@@ -66,19 +77,39 @@ def importpageone (p_file, p_file_type, p_charset)
@@ie.wait
end
begin
#Login
@@ie.goto("http://loordv01/pls/apex/f?p=#{ADID}:1")
@@ie.text_field(:id, "F#{ADID}_P1_COMPANY").set(WORKSPACE)
@@ie.text_field(:id, "F#{ADID}_P1_USERNAME").set(USER)
@@ie.text_field(:id, "F#{ADID}_P1_PASSWORD").set(PASSWORD)
@@ie.button(:value, 'Login').click
#
# this doesn't work as the P107_COMPANY is a javascript screen pop up thingy
def associateschema(p_workspace, p_schema)
login('INTERNAL','ADMIN','password')
@@ie.link(:title,'Manage Workspaces').click
@@ie.wait
#Import Application export file
@@ie.link(:title,'Manage Workspace to Schema Assignments').click
@@ie.button(:value, 'Create >').click
@@ie.wait
@@ie.radio(:id, 'P105_NEW_0' ).set
@@ie.wait
@@ie.button(:value, 'Next >').click
@@ie.wait
@@ie.text_field(:id, "P107_COMPANY" ).set(p_workspace)
@@ie.button(:value, 'Next >').click
@@ie.wait
@@ie.select_list(:id, "P106_SCHEMA").select p_schema
@@ie.wait
@@ie.button(:value, "Add Schema").click
@@ie.wait
@@ie.link('Logout').click
end
begin
# #Firstly, associate the schema with the workspace
# associateschema(WORKSPACE, SCHEMA)
# #Login
login(WORKSPACE, USER, PASSWORD)
# #Import Application export file
importpageone(APEX_EXPORT_SCRIPTS_DIR+APPLICATION_SCRIPT,
'Application, Page or Component Export',
'Western European Windows 1252')
#parse page
'Application, Page or Component Export',
'Western European Windows 1252')
# #parse page
@@ie.select_list(:id, "P49_PARSE_AS" ).select(SCHEMA)
@@ie.select_list(:id, "P49_BUILD_STATUS" ).select 'Run and Build Application'
@@ie.radio(:id, "P49_NEW_FLOW_OPT_2" ).set
@@ -86,53 +117,53 @@ begin
@@ie.text_field(:id, "P49_NEW_FLOW_ID").set(NEW_APP_ID)
@@ie.button(:value, 'Install').click
@@ie.wait
#This button won't appear the first time the import occurs
# #This button won't appear the first time the import occurs
if @@ie.button(:value, 'Replace Existing Application '+NEW_APP_ID).exists?
@@ie.button(:value, 'Replace Existing Application '+NEW_APP_ID).click
@@ie.wait
end
#Install Supporting objects
# #Install Supporting objects
@@ie.radio(:id, "P2100_ACTION_0" ).set
@@ie.button(:value, 'Next >').click
@@ie.wait
@@ie.button(:value, 'Install').click
@@ie.wait
#Install CSS
# #Install CSS
#Need to delete the existing CSS file before installing a new one
#have decided to just install the application for the moment.
#back to install page start
# #Need to delete the existing CSS file before installing a new one #have
# decided to just install the application for the moment. #back to install
# page start
#importpageone(APEX_EXPORT_SCRIPTS_DIR+CSS_SCRIPT,
# #importpageone(APEX_EXPORT_SCRIPTS_DIR+CSS_SCRIPT,
# 'CSS Export',
# 'Western European Windows 1252')
if DELETE_PREVIOUS_IMPORTS
#er this code does not work from the Loordv001 box
#it will run on JP's machine if this code is run from a
#dos prompt - it's an issue with ruby trying to spawn a
#new thead to look for the open dialogue box
# #er this code does not work from the Loordv001 box #it will run on JP's
# machine if this code is run from a #dos prompt - it's an issue with ruby
# trying to spawn a #new thead to look for the open dialogue box
@@ie.link(:title, 'Manage Export Repository').click
@@ie.wait
@@ie.checkboxes.each { |c| c.set }
#Click the annoying are you sure button that pops up
# #Click the annoying are you sure button that pops up
startClicker("OK", 1)
@@ie.button(:value, 'Delete Checked').click
@@ie.wait
end
@@ie.close
rescue StandardError => anyerror
#Hopefully we never get here but, we'll try and send an email if the
#script errors so we can fix it
#don't leave memory hungry instances of ie running if we get an error
@@ie.close
# #Hopefully we never get here but, we'll try and send an email if the #script
# errors so we can fix it #don't leave memory hungry instances of ie running
# if we get an error
@@ie.close
#build the email
from_addr = 'jamie.priest@advantica.com'
to_addr = 'jamie.priest@advanticagroup.com'
project = 'webMIP test build process'
emailtext = <<END_EMAIL
# #build the email
from_addr = 'jamie.priest@advantica.com'
to_addr = 'jamie.priest@advanticagroup.com'
project = 'webMIP test build process'
emailtext = <<END_EMAIL
From: webMIP <#{from_addr}>
To: Jamie Priest <#{to_addr}>
Subject: #{project} automated test failure