Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void LogInTest() throws InterruptedException{
- //INIT TEST
- Settings s = Settings.getInstance();
- List<String> uList = Arrays.asList(
- "buy1");
- List<String> rList = Arrays.asList(
- "Administrator",
- "Dossier Manager",
- "Buyer Manager",
- "Buyer",
- "Delivery Receiver",
- "Warehouse",
- "Viewer");
- List<String> oList = Arrays.asList(
- "SPF/FOD P-O en",
- "en_CA1",
- "en_CA2",
- "SPF/FOD P-O en",
- "en_CA1.1",
- "en_CA1.1.1",
- "SPF/FOD P-O en",
- "en_CA1.1",
- "en_CA1.1.1",
- "en_CA1.1",
- "en_CA1.1.1",
- "en_CA1.1.4",
- "en_CA1.1",
- "en_CA1.1.1",
- "ePROCen",
- "en_CA1.1",
- "en_CA1.1.1",
- "ePROCen",
- "en_CA1.1",
- "en_CA1.1.1",
- "ePROCen");
- int index=0;
- //INIT END
- //BEGIN TEST
- validatePresent(By.cssSelector("li.Password:nth-child(2) > a:nth-child(1)")).click();
- validatePresent(By.id("username")).sendKeys(s.getLoginUser());
- validatePresent(By.id("password")).sendKeys(s.getLoginPass());
- validatePresent(By.name("submit")).click();
- // validatePresent(By.cssSelector("div#Message p"));
- // Arrays.asList("Administrator", "Dossier Manager", "Buyer Manager", "Buyer", "Delivery Receiver", "Warehouse", "Viewer")
- // .forEach((text)->validatePresent(By.xpath("//select[@id='switchRoleId']/option[text()='"+text+"']"))
- // .click());
- //// .validatePresent(BySuccessAppMsg(text)));
- //
- // Thread.sleep(1000);
- // validatePresent(By.xpath("//*[@id=\"loginLoadOrgsButton\"]")).click();
- // validatePresent(By.xpath("/html/body/div[5]/div[2]/div/div/p[1]/a")).click();
- // validatePresent(By.xpath("//*[@id=\"loginLoadOrgsButton\"]")).click();
- // validatePresent(By.xpath("/html/body/div[5]/div[2]/div/div/p[2]/a")).click();
- validatePresent(BySuccessAppMsg("You have logged in as \""+uList.get(0)+"\"."));
- for (String user:rList){
- validatePresent(By.xpath("//select[@id='switchRoleId']/option[text()='"+user+"']")).click();
- validatePresent(BySuccessAppMsg("You have switched to user role \""+user+"\"."));
- for (int i=1; i<4; i++){
- validatePresent(By.xpath("//*[@id=\"loginLoadOrgsButton\"]")).click();
- validatePresent(By.xpath("/html/body/div[5]/div[2]/div/div/p["+i+"]/a")).click();
- validatePresent(BySuccessAppMsg("You have switched to organisation \""+oList.get(index)+"\"."));
- index++;
- }
- }
- //END TEST
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement