From 2d9aab8b54f46e560e9de8904118625ac0c9aa84 Mon Sep 17 00:00:00 2001 From: Mavlushechka Date: Wed, 2 Nov 2022 22:53:55 +0500 Subject: Add an assert to the 1st step --- src/test/java/com/mavlushechka/a1qa/project/TestCase1.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/test/java/com/mavlushechka') diff --git a/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java b/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java index 80b67b9..8b7afdf 100644 --- a/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java +++ b/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java @@ -9,6 +9,7 @@ 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.Assert; import org.testng.annotations.Test; import java.io.IOException; @@ -17,8 +18,10 @@ public class TestCase1 extends BaseTest { @Test 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"))); + LoggerUtils.step("Query the api to retrieve the token according to the variant number."); + int variant = Integer.parseInt(JsonParser.parseData("testData", "variant")); + String token = SiteApiUtils.generateToken(variant); + Assert.assertNotEquals(token, null, "The token is null."); ProjectsPage projectsPage = new ProjectsPage(); User user = JsonParser.convertToObject(JsonParser.parseObject("testData", "user"), User.class); -- cgit v1.2.3