Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component extends="mxunit.framework.TestCase" displayName="Positive Login Tests" output="false" {
- // Do before all tests in this file
- public void function setUp() {
- // dataproviders must be in the variables scope
- variables.ValidUsersAll = application.dataproviders['ValidUsersAll'];
- variables.selenium = application.selenium;
- }
- // Do after all tests in this file
- public void function tearDown() {
- }
- // ================ TESTS ================
- /**
- * Tests successful login of a user;
- * @mxunit:dataprovider ValidUsersAll
- */
- public void function login_ValidUser_Success_test(required Query argQuery){
- // force logout of any lingering logins
- LoginPage.logOut();
- // Page Object Model - Single snippet that models some page interaction
- LoginPage = new UITests.webtops.awebtop.Pages.Login.Login(selenium);
- LoginPage.login(argQuery.userid, argQuery.password);
- // move the following to a Disclaimer Page model
- assertTrue(selenium.isTextPresent("Do you agree to the disclaimer below?"));
- LoginPage.AgreeButton();
- assertEquals(selenium.getTitle(), "An Enterprise Application");
- selenium.selectFrame("main");
- selenium.selectFrame("relative=up");
- assertTrue(selenium.isTextPresent("Welcome #argQuery.firstName# #argQuery.lastName#"));
- LoginPage.logOut();
- assertTrue(selenium.isTextPresent("You are now logged out."));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement