Created
June 22, 2021 19:36
-
-
Save photizzo/cb93a0e3d31eff921556a6902bc41ced to your computer and use it in GitHub Desktop.
Disapprove and reject quote
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
package com.idealabs.Playground; | |
import io.testproject.sdk.drivers.ReportingDriver; | |
import io.testproject.sdk.drivers.web.RemoteWebDriver; | |
import io.testproject.sdk.interfaces.junit5.ExceptionsReporter; | |
import org.junit.jupiter.api.*; | |
import org.junit.jupiter.params.ParameterizedTest; | |
import org.junit.jupiter.params.provider.Arguments; | |
import org.junit.jupiter.params.provider.MethodSource; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeOptions; | |
import java.util.concurrent.TimeUnit; | |
import java.util.stream.Stream; | |
public class DisapprovingQuote implements ExceptionsReporter { | |
public WebDriver driver; | |
public String ApplicationURL = "https://broker.aktuarial.com/"; | |
@BeforeEach | |
void setup() throws Exception { | |
driver = new RemoteWebDriver("i5cYWbo3M94yqPIb-ckmD0w09Ep0MS8qPoFY6AbJfcY", new ChromeOptions(), ""); | |
} | |
@AfterEach | |
public void tearDown() { | |
driver.quit(); | |
} | |
@DisplayName("Disapprove a new quote") | |
@Test | |
public void execute() throws Exception { | |
// set timeout for driver actions (similar to step timeout) | |
driver.manage().timeouts().implicitlyWait(15000, TimeUnit.MILLISECONDS); | |
By by; | |
boolean booleanResult; | |
// 1. Generate a quote step | |
GeneratedUtils.sleep(500); | |
GQuote generateanewquote = new GQuote(); | |
generateanewquote.ApplicationURL = ApplicationURL; | |
generateanewquote.driver = driver; | |
generateanewquote.test(); | |
// 2. Logout a User | |
GeneratedUtils.sleep(1000); | |
LogoutUser logoutuser = new LogoutUser(); | |
logoutuser.ApplicationURL = ApplicationURL; | |
logoutuser.execute(driver); | |
// 3. Navigate to '{{ApplicationURL}}' | |
GeneratedUtils.sleep(1000); | |
driver.navigate().to(ApplicationURL); | |
// 4. Click 'identity' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("[name='identity']"); | |
driver.findElement(by).click(); | |
// 5. Type 'williamsohworuka@hotmail.com' in 'identity' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("[name='identity']"); | |
driver.findElement(by).sendKeys("williamsohworuka@hotmail.com"); | |
// 6. Click 'password' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("[name='password']"); | |
driver.findElement(by).click(); | |
// 7. Type 'ohwill949' in 'password' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("[name='password']"); | |
driver.findElement(by).sendKeys("ohwill949"); | |
// 8. Click 'Login' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//button[. = 'Login']"); | |
driver.findElement(by).click(); | |
// 9. Is 'Home' present? | |
GeneratedUtils.sleep(5000); | |
by = By.xpath("//a[. = 'Home']"); | |
driver.findElement(by); | |
// 10. Does 'OVERVIEW' contain 'OVERVIEW'? | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//div[. = 'OVERVIEW']"); | |
Assertions.assertTrue(driver.findElement(by).getText().contains("OVERVIEW")); | |
// 11. Click 'DIV24' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//body/div/div[2]/div[2]/div[1]/div/div"); | |
driver.findElement(by).click(); | |
// 12. Click 'DIV27' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//div/div[3]/div[3]/div[1]"); | |
driver.findElement(by).click(); | |
// 13. Type 'Rejecting this quote from testing' in 'remark' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("[name='remark']"); | |
driver.findElement(by).sendKeys("Rejecting this quote from testing"); | |
// 14. Click 'status' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("#rejectedId"); | |
driver.findElement(by).click(); | |
// 15. Click 'Disapprove Quote' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//span[. = 'Disapprove Quote']"); | |
driver.findElement(by).click(); | |
// 16. Is 'Pop Up' present? | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//body/div/div[1]/div/div"); | |
driver.findElement(by); | |
} | |
@Override | |
public ReportingDriver getDriver() { | |
return (ReportingDriver) driver; | |
} | |
} |
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
package com.idealabs.Playground; | |
import io.testproject.sdk.drivers.ReportingDriver; | |
import io.testproject.sdk.interfaces.junit5.ExceptionsReporter; | |
import java.lang.Exception; | |
import java.lang.Override; | |
import java.lang.String; | |
import java.util.concurrent.TimeUnit; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
/** | |
* This class was automatically generated by TestProject | |
* Project: Aktuarial Website | |
* Test: Logout User | |
* Generated by: Olaoye Christiana (olaoyechristy97@gmail.com) | |
* Generated on Tue Jun 22 18:59:44 GMT 2021. | |
*/ | |
public class LogoutUser implements ExceptionsReporter { | |
public static WebDriver driver; | |
/** | |
* ApplicationURL test parameter | |
*/ | |
public String ApplicationURL = "https://broker.aktuarial.com/"; | |
public void execute(WebDriver parentDriver) throws Exception { | |
driver = parentDriver; | |
// 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 'Home' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//a[. = 'Home']"); | |
driver.findElement(by).click(); | |
// 3. Click 'IMG1' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//body/div/div[2]/div[2]/div[1]//img"); | |
driver.findElement(by).click(); | |
// 4. Click 'Logout' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//p[2][. = 'Logout']"); | |
driver.findElement(by).click(); | |
} | |
@Override | |
public ReportingDriver getDriver() { | |
return (ReportingDriver) driver; | |
} | |
} |
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
package com.idealabs.Playground; | |
import io.testproject.sdk.drivers.ReportingDriver; | |
import io.testproject.sdk.drivers.web.RemoteWebDriver; | |
import io.testproject.sdk.interfaces.junit5.ExceptionsReporter; | |
import org.junit.jupiter.api.*; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeOptions; | |
import java.util.concurrent.TimeUnit; | |
public class RejectAQuote implements ExceptionsReporter { | |
public WebDriver driver; | |
public String ApplicationURL = "https://broker.aktuarial.com/"; | |
@BeforeEach | |
void setup() throws Exception { | |
driver = new RemoteWebDriver("i5cYWbo3M94yqPIb-ckmD0w09Ep0MS8qPoFY6AbJfcY", new ChromeOptions(), ""); | |
} | |
@AfterEach | |
public void tearDown() { | |
driver.quit(); | |
} | |
@DisplayName("Reject a quote") | |
@Test | |
public void execute() throws Exception { | |
// set timeout for driver actions (similar to step timeout) | |
driver.manage().timeouts().implicitlyWait(15000, TimeUnit.MILLISECONDS); | |
By by; | |
boolean booleanResult; | |
// 1. Disapprove a quote step | |
GeneratedUtils.sleep(500); | |
DisapprovingQuote disapprovingQuote = new DisapprovingQuote(); | |
disapprovingQuote.ApplicationURL = ApplicationURL; | |
disapprovingQuote.driver = driver; | |
disapprovingQuote.execute(); | |
// 2. Logout a User | |
GeneratedUtils.sleep(1000); | |
LogoutUser logoutuser = new LogoutUser(); | |
logoutuser.ApplicationURL = ApplicationURL; | |
logoutuser.execute(driver); | |
// 3. Navigate to '{{ApplicationURL}}' | |
GeneratedUtils.sleep(1000); | |
driver.navigate().to(ApplicationURL); | |
// 3. Type 'aktuarialtesting@mailinator.com' in 'identity' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("[name='identity']"); | |
driver.findElement(by).sendKeys("aktuarialtesting@mailinator.com"); | |
// 4. Type '@Aktuarial4' in 'password' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("[name='password']"); | |
driver.findElement(by).sendKeys("@Aktuarial4"); | |
// 5. Click 'Login2' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//span[. = 'Login']"); | |
driver.findElement(by).click(); | |
// 6. Click 'DIV24' | |
GeneratedUtils.sleep(5000); | |
by = By.xpath("//body/div/div[2]/div[2]/div[1]/div/div"); | |
driver.findElement(by).click(); | |
// 7. Click 'DIV25' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//div[2]/div[3]/div[3]/div[1]"); | |
driver.findElement(by).click(); | |
// 8. Click 'status' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("#rejectedId"); | |
driver.findElement(by).click(); | |
// 9. Click 'remark' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("[name='remark']"); | |
driver.findElement(by).click(); | |
// 10. Type 'Rejecting Quote' in 'remark' | |
GeneratedUtils.sleep(500); | |
by = By.cssSelector("[name='remark']"); | |
driver.findElement(by).sendKeys("Rejecting Quote"); | |
// 11. Click 'Reject Quote1' | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//span[. = 'Reject Quote']"); | |
driver.findElement(by).click(); | |
// 12. Does 'Rejected' contain 'Rejected'? | |
GeneratedUtils.sleep(500); | |
by = By.xpath("//span[. = 'Rejected']"); | |
Assertions.assertTrue(driver.findElement(by).getText().contains("Rejected")); | |
} | |
@Override | |
public ReportingDriver getDriver() { | |
return (ReportingDriver) driver; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment