diff options
| author | Mavlushechka <mavlushechka@gmail.com> | 2022-11-16 14:54:25 +0500 | 
|---|---|---|
| committer | Mavlushechka <mavlushechka@gmail.com> | 2022-11-16 15:06:42 +0500 | 
| commit | ac47d5ddc69b4a210821374467c0e175148fd1af (patch) | |
| tree | 7832c43216d3c3bd409c991bfe725739e6b0a746 /src/test | |
| parent | 0040cf96449ab6a2c109ce8f6a0ca88f2182e97c (diff) | |
Remove LoggerUtils class
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/java/com/mavlushechka/a1qa/framework/BaseTest.java | 2 | ||||
| -rw-r--r-- | src/test/java/com/mavlushechka/a1qa/project/TestCase1.java | 11 | 
2 files changed, 5 insertions, 8 deletions
diff --git a/src/test/java/com/mavlushechka/a1qa/framework/BaseTest.java b/src/test/java/com/mavlushechka/a1qa/framework/BaseTest.java index bd4ab47..e1a2bfc 100644 --- a/src/test/java/com/mavlushechka/a1qa/framework/BaseTest.java +++ b/src/test/java/com/mavlushechka/a1qa/framework/BaseTest.java @@ -2,7 +2,6 @@ package com.mavlushechka.a1qa.framework;  import aquality.selenium.browser.AqualityServices;  import com.mavlushechka.a1qa.framework.utils.JsonParser; -import com.mavlushechka.a1qa.framework.utils.LoggerUtils;  import org.testng.annotations.AfterTest;  import org.testng.annotations.BeforeSuite; @@ -10,7 +9,6 @@ public abstract class BaseTest {      @BeforeSuite      public void setUp() { -        LoggerUtils.initialize();          AqualityServices.getBrowser().goTo(JsonParser.parseData("config", "browser.url"));      } diff --git a/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java b/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java index 0bc1d61..d827f04 100644 --- a/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java +++ b/src/test/java/com/mavlushechka/a1qa/project/TestCase1.java @@ -3,7 +3,6 @@ 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.framework.utils.StringUtils;  import com.mavlushechka.a1qa.project.models.User;  import com.mavlushechka.a1qa.project.pages.AddProjectPage; @@ -25,13 +24,13 @@ public class TestCase1 extends BaseTest {      @Test      public void test1() throws IOException { -        LoggerUtils.step("Query the api to retrieve the token according to the variant number."); +        AqualityServices.getLogger().info("Step 1:", "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(); -        LoggerUtils.step("Go to the website. Complete the necessary authorisation." +        AqualityServices.getLogger().info("Step 2:", "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(JsonParser.convertToObject(JsonParser.parseObject("testData", "user"), User.class));          Assert.assertTrue(projectsPage.state().waitForDisplayed(), "The %s page is not opened.".formatted(projectsPage.getName())); @@ -39,7 +38,7 @@ public class TestCase1 extends BaseTest {          AqualityServices.getBrowser().refresh();          Assert.assertEquals(projectsPage.getVersion(), variant, "The variant is not correct."); -        LoggerUtils.step("Go to the Nexage project page. Query the api to get a list of tests in JSON/XML format."); +        AqualityServices.getLogger().info("Step 3:", "Go to the Nexage project page. Query the api to get a list of tests in JSON/XML format.");          projectsPage.openProject(JsonParser.parseData("testData", "project.name"));          TestsPage testsPage = new TestsPage();          Assert.assertTrue(testsPage.state().waitForDisplayed(), "The %s page is not opened.".formatted(testsPage.getName())); @@ -56,7 +55,7 @@ public class TestCase1 extends BaseTest {          Assert.assertTrue(allRunningTestsReceivedByApi.containsAll(allRunningTestsOnSite),                  "All running tests received by API not contains all running tests on site."); -        LoggerUtils.step("Return to the previous page in the browser (project page). Press +Add. Enter the project name, and save." +        AqualityServices.getLogger().info("Step 4:", "Return to the previous page in the browser (project page). Press +Add. Enter the project name, and save."                  + "Call the closePopUp() js-method to close the add project window. Refresh the page.");          AqualityServices.getBrowser().goBack();          projectsPage.clickOnAddButton(); @@ -77,7 +76,7 @@ public class TestCase1 extends BaseTest {          AqualityServices.getBrowser().refresh();          Assert.assertTrue(projectsPage.getProjects().contains(projectName), "The project is not saved."); -        LoggerUtils.step("Go to the created project page. Add test via API (along with log and screenshot of current page)."); +        AqualityServices.getLogger().info("Step 5:", "Go to the created project page. Add test via API (along with log and screenshot of current page).");          projectsPage.openProject(projectName);          String testName = randomTextGenerator.get();          int testId = SiteApiUtils.putTest(  |