Skip to content

Instantly share code, notes, and snippets.

@photizzo
Created June 21, 2021 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save photizzo/6bf0298cf2956287c85703af0939fc28 to your computer and use it in GitHub Desktop.
Save photizzo/6bf0298cf2956287c85703af0939fc28 to your computer and use it in GitHub Desktop.
// set timeout for driver actions (similar to step timeout)
driver.manage().timeouts().implicitlyWait(15000, TimeUnit.MILLISECONDS);
By by;
boolean booleanResult;
// 1. Navigate to '{{ApplicationURL}}'
// Navigates the specified URL (Auto-generated)
GeneratedUtils.sleep(500);
driver.navigate().to(ApplicationURL);
// 2. Click 'identity'
GeneratedUtils.sleep(500);
by = By.cssSelector("[name='identity']");
driver.findElement(by).click();
// 3. Click 'identity'
GeneratedUtils.sleep(500);
by = By.cssSelector("[name='identity']");
driver.findElement(by).click();
// 4. Type 'williamsohworuka@hotmail.com' in 'identity'
GeneratedUtils.sleep(500);
by = By.cssSelector("[name='identity']");
driver.findElement(by).sendKeys("williamsohworuka@hotmail.com");
// 5. Click 'password'
GeneratedUtils.sleep(500);
by = By.cssSelector("[name='password']");
driver.findElement(by).click();
// 6. Type 'ohwill949' in 'password'
GeneratedUtils.sleep(500);
by = By.cssSelector("[name='password']");
driver.findElement(by).sendKeys("ohwill949");
// 7. Click 'Login'
GeneratedUtils.sleep(500);
by = By.xpath("//button[. = 'Login']");
driver.findElement(by).click();
// 8. Is 'Home' present?
GeneratedUtils.sleep(500);
by = By.xpath("//a[. = 'Home']");
driver.findElement(by);
// 9. Does 'OVERVIEW' contain 'OVERVIEW'?
GeneratedUtils.sleep(500);
by = By.xpath("//div[. = 'OVERVIEW']");
Assertions.assertTrue(driver.findElement(by).getText().contains("OVERVIEW"));
// 10. Click 'svg2'
GeneratedUtils.sleep(5000);
by = By.xpath("//div[2]/div/*[name()='svg']");
driver.findElement(by).click();
// 11. Click 'Quote Submitted'
GeneratedUtils.sleep(500);
by = By.xpath("//div[1]/h4[. = 'Quote Submitted']");
driver.findElement(by).click();
// 12. Click 'remark'
GeneratedUtils.sleep(500);
by = By.cssSelector("[name='remark']");
driver.findElement(by).click();
// 13. Type 'Approved' in 'remark'
GeneratedUtils.sleep(500);
by = By.cssSelector("[name='remark']");
driver.findElement(by).sendKeys("Approved");
// 14. Click 'approvalStatus'
GeneratedUtils.sleep(500);
by = By.cssSelector("#approvalId");
driver.findElement(by).click();
// 15. Click 'Approve Quote'
GeneratedUtils.sleep(500);
by = By.xpath("//button[. = 'Approve Quote']");
driver.findElement(by).click();
// 16. Is 'Quote approved successfully' present?
GeneratedUtils.sleep(500);
by = By.xpath("//div[. = 'Quote approved successfully']");
driver.findElement(by);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment