-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
677f5e5
commit d90500b
Showing
4 changed files
with
88 additions
and
91 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,38 @@ | ||
package testPackage; | ||
|
||
import com.shaft.driver.DriverFactory; | ||
import com.shaft.driver.SHAFT; | ||
import com.shaft.gui.browser.BrowserActions; | ||
import com.shaft.gui.element.ElementActions; | ||
import com.shaft.validation.Validations; | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebDriver; | ||
import org.testng.annotations.AfterMethod; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
public class DynamicLoadingTest { | ||
private static final ThreadLocal<WebDriver> driver = new ThreadLocal<>(); | ||
private static final ThreadLocal<SHAFT.GUI.WebDriver> driver = new ThreadLocal<>(); | ||
|
||
@Test | ||
public void dynamicLoading_elementIsHidden() { | ||
new BrowserActions(driver.get()).navigateToURL("https://the-internet.herokuapp.com/dynamic_loading/1"); | ||
new ElementActions(driver.get()).click(By.xpath("//button[text()='Start']")); | ||
Validations.assertThat().element(driver.get(), By.id("finish")).text().contains("Hello World!").perform(); | ||
new BrowserActions(driver.get().getDriver()).navigateToURL("https://the-internet.herokuapp.com/dynamic_loading/1"); | ||
new ElementActions(driver.get().getDriver()).click(By.xpath("//button[text()='Start']")); | ||
Validations.assertThat().element(driver.get().getDriver(), By.id("finish")).text().contains("Hello World!").perform(); | ||
} | ||
|
||
@Test | ||
public void dynamicLoading_elementIsRendered() { | ||
new BrowserActions(driver.get()).navigateToURL("https://the-internet.herokuapp.com/dynamic_loading/2"); | ||
new ElementActions(driver.get()).click(By.xpath("//button[text()='Start']")); | ||
Validations.assertThat().element(driver.get(), By.id("finish")).text().contains("Hello World!").perform(); | ||
new BrowserActions(driver.get().getDriver()).navigateToURL("https://the-internet.herokuapp.com/dynamic_loading/2"); | ||
new ElementActions(driver.get().getDriver()).click(By.xpath("//button[text()='Start']")); | ||
Validations.assertThat().element(driver.get().getDriver(), By.id("finish")).text().contains("Hello World!").perform(); | ||
} | ||
|
||
@BeforeMethod | ||
public void beforeMethod() { | ||
driver.set(new DriverFactory().getDriver()); | ||
driver.set(new SHAFT.GUI.WebDriver()); | ||
} | ||
|
||
@AfterMethod(alwaysRun = true) | ||
public void afterMethod() { | ||
new BrowserActions(driver.get()).closeCurrentWindow(); | ||
driver.get().quit(); | ||
} | ||
} |
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