diff options
Diffstat (limited to 'src/test/java/com/mavlushechka')
-rw-r--r-- | src/test/java/com/mavlushechka/a1qa/project/TestCase1.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java b/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java index e50f89b..722b0da 100644 --- a/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java +++ b/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java @@ -1,9 +1,13 @@ package com.mavlushechka.a1qa.project; +import aquality.selenium.browser.AqualityServices; import com.mavlushechka.a1qa.framework.BaseTest; import com.mavlushechka.a1qa.framework.utils.JsonParser; import com.mavlushechka.a1qa.framework.utils.LoggerUtils; +import com.mavlushechka.a1qa.project.models.User; +import com.mavlushechka.a1qa.project.pages.ProjectsPage; import com.mavlushechka.a1qa.project.utils.SiteApiUtils; +import org.openqa.selenium.Cookie; import org.testng.annotations.Test; import java.io.IOException; @@ -14,6 +18,14 @@ public class TestCase1 extends BaseTest { public void test1() throws IOException { LoggerUtils.step("Query the api to retrieve the token according to the option number."); String token = SiteApiUtils.generateToken(Integer.parseInt(JsonParser.parseData("testData", "variant"))); + + ProjectsPage projectsPage = new ProjectsPage(); + User user = JsonParser.convertToObject(JsonParser.parseObject("testData", "user"), User.class); + LoggerUtils.step("Go to the website. Complete the necessary authorisation." + + "Transfer the token (parameter token) generated in step 1 using a cookie. Refresh the page."); + projectsPage.performAuthorization(user); + AqualityServices.getBrowser().getDriver().manage().addCookie(new Cookie("token", token)); + AqualityServices.getBrowser().refresh(); } } |