diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/mavlushechka/a1qa/pages/GamePage.java | 5 | ||||
-rw-r--r-- | src/main/resources/testData.json | 3 | ||||
-rw-r--r-- | src/test/java/com/mavlushechka/a1qa/TestCase4.java | 22 |
3 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/com/mavlushechka/a1qa/pages/GamePage.java b/src/main/java/com/mavlushechka/a1qa/pages/GamePage.java index 63db5de..2e80d32 100644 --- a/src/main/java/com/mavlushechka/a1qa/pages/GamePage.java +++ b/src/main/java/com/mavlushechka/a1qa/pages/GamePage.java @@ -11,6 +11,7 @@ public class GamePage extends BaseForm { private final SecondCardForm secondCardForm = new SecondCardForm(); private final HelpForm helpForm = new HelpForm(); private final CookiesForm cookiesForm = new CookiesForm(); + private final Label timer = new Label(By.xpath("//*[contains(@class, 'timer')]"), "Timer"); public GamePage() { @@ -53,4 +54,8 @@ public class GamePage extends BaseForm { return cookiesForm.isHidden(); } + public String getTimerText() { + return timer.getText(); + } + } diff --git a/src/main/resources/testData.json b/src/main/resources/testData.json index e6d034b..987011f 100644 --- a/src/main/resources/testData.json +++ b/src/main/resources/testData.json @@ -1,5 +1,8 @@ { "testCase1": { "interestsToChoose": 3 + }, + "testCase4": { + "timerStartingText": "00:00:00" } }
\ No newline at end of file diff --git a/src/test/java/com/mavlushechka/a1qa/TestCase4.java b/src/test/java/com/mavlushechka/a1qa/TestCase4.java new file mode 100644 index 0000000..50b8be2 --- /dev/null +++ b/src/test/java/com/mavlushechka/a1qa/TestCase4.java @@ -0,0 +1,22 @@ +package com.mavlushechka.a1qa; + +import com.mavlushechka.a1qa.pages.GamePage; +import com.mavlushechka.a1qa.pages.HomePage; +import com.mavlushechka.a1qa.utils.JSONParser; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TestCase4 extends BaseTest { + + @Test + public void test() { + HomePage homePage = new HomePage(); + Assert.assertTrue(homePage.isOpened(), "This is not the " + homePage.getName() + "."); + homePage.clickNextPageButton(); + + GamePage gamePage = new GamePage(); + Assert.assertTrue(gamePage.isOpened(), "This is not the " + gamePage.getName() + "."); + Assert.assertEquals(gamePage.getTimerText(), JSONParser.parse("testData", "testCase4.timerStartingText"), "This is not the " + gamePage.getName() + "."); + } + +} |