Created
May 29, 2018 08:24
-
-
Save PavelCp/1cf05c6244f5ee4eb985b8eb187753af to your computer and use it in GitHub Desktop.
Test case verifies ability to sort events present in Actu mandat (Formateur) using "Statut mandat" filter field.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.Keys; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.support.PageFactory; | |
import org.testng.Assert; | |
import org.testng.annotations.Test; | |
public class ucAM4 extends AbstractTest { | |
@Test | |
/** | |
* Test case verifies ability to sort events present in Actu mandat (Formateur) using "Statut mandat" filter field. | |
*/ | |
public void checkFilter() { | |
DesiredCapabilities capabilities = DesiredCapabilities.firefox(); | |
capabilities.setCapability("marionette", true); | |
System.setProperty( | |
"webdriver.gecko.driver", | |
"C:/geckodriver.exe"); | |
driver = new FirefoxDriver(); | |
driver.manage().window().maximize(); | |
driver.get("https://dev.agenda.ahead-digital.eu"); | |
PgLogin pgLogin = PageFactory.initElements(driver, PgLogin.class); | |
pgLogin.loginAsFormateur(); | |
PgFormateur pgFormateur = PageFactory.initElements(driver, PgFormateur.class); | |
pgFormateur.statusField.get(0).sendKeys(Keys.BACK_SPACE); | |
pgFormateur.statusField.get(0).sendKeys(Keys.BACK_SPACE); | |
pgFormateur.statusField.get(0).sendKeys(Keys.BACK_SPACE); | |
for (int m = 0; m < pgFormateur.ddSelection.size(); m++) { | |
pgFormateur.statusField.get(0).click(); | |
String expected = pgFormateur.ddSelection.get(m).getText(); | |
System.out.println(expected); | |
pgFormateur.ddSelection.get(m).click(); | |
pgFormateur.btnApply.click(); | |
for (int j = 0; j < pgFormateur.days.size(); j++) { | |
for (int i = 0; i < pgFormateur.sessionStatus.size(); i++) { | |
Assert.assertEquals(pgFormateur.sessionStatus.get(i).getText(), expected); | |
} | |
pgFormateur.days.get(j).click(); | |
System.out.println("dYS COUNT - " + pgFormateur.days.size() + ", was clicked # " + j); | |
} | |
pgFormateur.statusField.get(0).click(); | |
pgFormateur.statusField.get(0).sendKeys(Keys.BACK_SPACE); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment