Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfcomponent
- displayname="UITests_Migration_FirstQuote"
- output="false"
- hint="Automated UI testing for FirstQuote webtop using CFSelenium">
- <!--- Set up the application using convention: name = UITests_{branch}_{webtop} --->
- <cfset THIS.Name = "UITests_Migration_Webtop" />
- <cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 0, 3, 0 ) />
- <cfset THIS.SessionManagement = false />
- <cfset THIS.ClientManagement = false />
- <cfset THIS.SetClientCookies = false />
- <!--- Define the page request properties. --->
- <cfsetting
- requesttimeout="180"
- showdebugoutput="false"
- enablecfoutputonly="false"
- />
- <cffunction
- name="OnApplicationStart"
- access="public"
- returntype="boolean"
- output="false"
- hint="Fires when the application is first created.">
- <cfscript>
- // Initialize Selenium client for this webtop
- application.browserUrl = "https://mywebtop.mycompany.com"; // CHANGE THIS PER WEBTOP
- application.browserStartCommand = "*firefox3 C:/Program Files (x86)/Mozilla Firefox/firefox.exe"; // UNIQUE TO YOUR SYSTEM
- application.TestCaseManager = new UITests.comps.TSuiteManager();
- if (CGI.SCRIPT_NAME CONTAINS "/Tests" OR CGI.SCRIPT_NAME CONTAINS "/Automation"){
- application.TestCaseManager.startClient(browserUrl=application.browserURL,browserStartCommand=application.browserStartCommand);
- }
- // Set location for UITests root, which is higher than the application level
- application.UITestsRoot = trim(listfirst(replace(getDirectoryFromPath(expandPath('*.*')) & "..\..","UITests\","UITests\ ","one")," "));
- // Create all the dataproviders for the test suite
- application.dp = createObject("component","UITests.dataproviders.DataProvider").init();
- application.dp.setUITestsRoot(application.UITestsRoot);
- application.dpIndex = application.dp.getDataProvidersIndex();
- application.dataproviders = application.dp.createDataProviders();
- // Create helper CFC
- application.utils = new UITests.comps.Utils();
- </cfscript>
- <cflog application="true" text="-------> Application '#this.name#' started">
- <!--- Return out. --->
- <cfreturn true />
- </cffunction>
- <cffunction
- name="OnRequestStart"
- access="public"
- returntype="boolean"
- output="false"
- hint="Fires at first part of page processing.">
- <!--- Define arguments. --->
- <cfargument
- name="TargetPage"
- type="string"
- required="true"
- />
- <!--- Return out. --->
- <cfreturn true />
- </cffunction>
- <cffunction
- name="OnApplicationEnd"
- access="public"
- returntype="void"
- output="false"
- hint="Fires when the application is terminated.">
- <!--- Define arguments. --->
- <cfargument
- name="ApplicationScope"
- type="struct"
- required="false"
- default="#StructNew()#"
- />
- <cfset application.TestCaseManager.stopClient()>
- <cflog application="true" text="-------> #this.name# stopped">
- <!--- Return out. --->
- <cfreturn />
- </cffunction>
- </cfcomponent>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement