Skip to content

Commit 6bebad2

Browse files
author
Kamil Nowocin
committed
feat: Build minor adjustments
1 parent 86c6cd4 commit 6bebad2

22 files changed

+289
-323
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ Supported browsers aka hosts:
2626
* Support for Allure Report
2727
* Support for .xlsx files
2828
* Support for Fake & Mock data
29+
* Support for BrowserStack
2930
## TEST RESULTS
30-
* After each CI/CD cycle run, tests results will be automatically uploaded to [kamil_nowocin/allure_report](https://kamil-nowocin.github.io/Test_Automation-automationpractice/)
31+
* After each CI/CD cycle run, tests results will be automatically uploaded to [kamil_nowocin/github.io/allure_report](https://kamil-nowocin.github.io/Test_Automation-automationpractice/)
3132
* After each LOCAL cycle run, tests results will be stored in build/allure-report.
3233
In terminal type `allure generate build/allure-report --clean` to generate local Allure Test Results
33-
##LOGS
34+
## TEST LOGS
3435
There are two types of log information saved after each test run:
3536
* Detailed logs in log directory. Warning! These logs will be deleted when you launch new test run.
3637
* Colorful logs in testdata.xls file. Warning! These logs will be overwritten when you launch new test run. <sub><sup>(Only for TestNG runners)</sup></sub>

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ test {
9090
ignoreFailures = true
9191
useTestNG()
9292
{
93-
suites "src/test/resources/xml_runners/TestNG-WEB.xml"
94-
suites "src/test/resources/xml_runners/TestNG-API.xml"
93+
suites "src/test/resources/xml_runners/TestNG-WebAPP.xml"
94+
suites "src/test/resources/xml_runners/TestNG-WebAPI.xml"
9595
suites "src/test/resources/xml_runners/TestNG-POC.xml"
9696
}
9797
systemProperties System.properties
@@ -105,6 +105,6 @@ task exper(type: JavaExec, dependsOn: 'classes') {
105105
project.sourceSets.test.compileClasspath,
106106
project.sourceSets.main.runtimeClasspath,
107107
project.sourceSets.test.runtimeClasspath)
108-
args = ["./src/test/resources/xml_runners/TestNG-WEB.xml", "./src/test/resources/xml_runners/TestNG-API.xml",
108+
args = ["./src/test/resources/xml_runners/TestNG-WebAPP.xml", "./src/test/resources/xml_runners/TestNG-WebAPI.xml",
109109
"./src/test/resources/xml_runners/TestNG-POC.xml"]
110110
}

src/test/java/com/FrameworkEnvironment.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040

4141
public class FrameworkEnvironment {
4242

43-
protected static Logger logger = LoggerFactory.getLogger(Hooks.class);
44-
protected static Faker faker = new Faker(new Locale("en-US"));
43+
protected static Faker faker = new Faker(Locale.US);
4544
protected static MockNeat mockNeat = MockNeat.threadLocal();
45+
protected static Logger logger = LoggerFactory.getLogger(Hooks.class);
4646
protected static DecimalFormat $decimalFormat = new DecimalFormat("$#0.00", new DecimalFormatSymbols(Locale.US));
4747

4848
//BUNDLES//
@@ -197,10 +197,10 @@ protected void deleteOldLogs() {
197197

198198
public void printWebDriverManagerVersions(Boolean boolStatus) {
199199
if (boolStatus) {
200-
logger.info("ChromeDriver available versions: " + WebDriverManager.chromedriver().getVersions() + "\n");
201-
logger.info("GeckoDriver available versions: " + WebDriverManager.firefoxdriver().getVersions() + "\n");
202-
logger.info("OperaDriver available versions: " + WebDriverManager.operadriver().getVersions() + "\n");
203-
logger.info("EdgeDriver available versions: " + WebDriverManager.edgedriver().getVersions() + "\n");
200+
logger.info("ChromeDriver available versions: " + WebDriverManager.chromedriver().getVersions());
201+
logger.info("GeckoDriver available versions: " + WebDriverManager.firefoxdriver().getVersions());
202+
logger.info("OperaDriver available versions: " + WebDriverManager.operadriver().getVersions());
203+
logger.info("EdgeDriver available versions: " + WebDriverManager.edgedriver().getVersions());
204204
logger.info("IE available versions: " + WebDriverManager.iedriver().getVersions());
205205
}
206206
}

src/test/java/com/steps/RegistrationPageSteps.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,14 @@ public void iChooseGender() throws Throwable {
186186
if (randomNumber == 1) {
187187
registrationPage.mrButton.click();
188188
logger.info("User gender: Male");
189+
189190
//ASSERT//
190191
Assert.assertTrue(registrationPage.mrButton.isSelected());
191192

192193
} else {
193194
registrationPage.mrsButton.click();
194195
logger.info("User gender: Female");
196+
195197
//ASSERT//
196198
Assert.assertTrue(registrationPage.mrsButton.isSelected());
197199
}
@@ -282,7 +284,7 @@ public void iChooseDateOfBirth() throws Throwable {
282284
@And("I sign in to receive newsletter and special offers")
283285
public void iSignInToReceiveNewsletterAndSpecialOffers() throws Throwable {
284286
//ARRANGE//
285-
int tempRandomValue = basePage.randomIntValue(3, 1);
287+
int tempRandomValue = basePage.randomIntValue(3, 3);
286288

287289
//ACT//
288290
if (tempRandomValue == 1) {
@@ -302,8 +304,7 @@ public void iSignInToReceiveNewsletterAndSpecialOffers() throws Throwable {
302304
Assert.assertTrue(registrationPage.specialOffersCheckbox.isSelected());
303305

304306
} else {
305-
if (!registrationPage.newsletterCheckbox.isSelected() &&
306-
registrationPage.specialOffersCheckbox.isSelected()) {
307+
if (!registrationPage.newsletterCheckbox.isSelected() && !registrationPage.specialOffersCheckbox.isSelected()) {
307308
registrationPage.newsletterCheckbox.click();
308309
registrationPage.specialOffersCheckbox.click();
309310
logger.info("User signed to receive newsletter & special offers");

src/test/java/com/steps/SearchPageSteps.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ public void iCanSeeThatEveryResultsWhichHaveBeenFoundContainsPhrase(String searc
8080
}
8181

8282
} else {
83-
Assert.assertTrue(basePage.isDisplayed(5, searchPage.noResultsWereFoundHeader), VIEW_ERROR);
83+
Assert.assertTrue(basePage.isDisplayed(5, searchPage.noResultsWereFoundHeader),
84+
String.format(VIEW_ERROR, "No result header"));
8485
}
8586
}
8687

src/test/java/com/steps/ShoppingLoggedUserSteps.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public ShoppingLoggedUserSteps(ContextInjection contextInjection) {
4040

4141
@Step("I click on *{0}* button from sub menu")
4242
@And("I click on {string} button from sub menu")
43-
public void iClickOnButtonFromSubMenu(String category) throws Throwable {
43+
public void iClickOnButtonFromSubMenu(String subMenuCategory) throws Throwable {
4444
//ACT//
45-
switch (category.toLowerCase()) {
45+
switch (subMenuCategory.toLowerCase()) {
4646
case "women":
4747
mainPage.subMenuWomen.click();
4848
break;
@@ -56,13 +56,13 @@ public void iClickOnButtonFromSubMenu(String category) throws Throwable {
5656
break;
5757

5858
default:
59-
throw new IllegalStateException(String.format(INPUT_ERROR, category.toUpperCase()));
59+
throw new IllegalStateException(String.format(INPUT_ERROR, subMenuCategory.toUpperCase()));
6060
}
61-
logger.info(String.format("User clicked on: %S submenu category", category));
61+
logger.info(String.format("User clicked on: %S submenu category", subMenuCategory));
6262

6363
//ASSERT//
6464
Assert.assertEquals(mainPage.subMenuChosenCategory.getText().replaceAll
65-
("\\s+", "").toLowerCase(), category.toLowerCase(), VALUE_ERROR);
65+
("\\s+", "").toLowerCase(), subMenuCategory.toLowerCase(), VALUE_ERROR);
6666
}
6767

6868
@Step("I click on following product *{0}*")
@@ -210,10 +210,10 @@ public void iCanSeeShoppingCartFormWithValidInformation(String shoppingSummaryTa
210210
Assert.assertEquals(shoppingCartSummaryPage.productTotalPrice.getText()
211211
.replaceAll("[^$0-9.]", ""),
212212
$decimalFormat.format(contextInjection.finalProductTotalPrice), VALUE_ERROR);
213-
//TODO - how tax is calculated in america?
214-
//Assert.assertEquals(shoppingCartSummaryPage.productTotalOrderPriceTAX.getText()
215-
// .replaceAll("[$]*[^$0-9.]", "").replace(".", ","),
216-
// decimalFormat.format(productTotalOrderPriceWithTax), VALUE_ERROR);
213+
/* //TODO - how tax is calculated in america?
214+
Assert.assertEquals(shoppingCartSummaryPage.productTotalOrderPriceTAX.getText()
215+
.replaceAll("[$]*[^$0-9.]", ""),
216+
$decimalFormat.format(productTotalOrderPriceWithTax), VALUE_ERROR);*/
217217
break;
218218

219219
case "addresses":
@@ -287,7 +287,8 @@ public void iWriteCommentAboutMyOrder() throws Throwable {
287287
logger.info(String.format("User comment order: %S", orderComment.toUpperCase()));
288288

289289
//ASSERT//
290-
Assert.assertEquals(shoppingCartSummaryPage.orderComment.getAttribute("value").toLowerCase(), orderComment.toLowerCase(), VALUE_ERROR);
290+
Assert.assertEquals(shoppingCartSummaryPage.orderComment.getAttribute("value").toLowerCase(),
291+
orderComment.toLowerCase(), VALUE_ERROR);
291292
}
292293

293294
@Step("I choose shipping option *{0}*")

src/test/java/tests/POC/POC_Tests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public void testSteps(XSSFRow row) {
2727
}
2828

2929
@Ignore
30-
@Owner("Kamil Nowocin")
31-
@Test(priority = 0,
32-
description = "As a developer I'd like to see working POC with .xlsx file")
33-
@Description("As a developer I'd like to see working POC with .xlsx file")
34-
@Severity(SeverityLevel.MINOR)
3530
@Issue("TAP-POC")
3631
@Story("POC Tests")
32+
@Owner("Kamil Nowocin")
33+
@Severity(SeverityLevel.MINOR)
34+
@Description("As a developer I'd like to see working POC with .xlsx file")
35+
@Test(description = "As a developer I'd like to see working POC with .xlsx file",
36+
priority = 0)
3737
public void excelTest() throws Throwable {
3838
//ARRANGE//
3939
ExcelEnvironment.saveTestResultsXLSX(50);

src/test/java/tests/API/API_Tests.java renamed to src/test/java/tests/WebAPI/API_Tests.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tests.API;
1+
package tests.WebAPI;
22

33
import com.ExcelEnvironment;
44
import com.listeners.TestNGListener_API;
@@ -34,11 +34,13 @@ public void beforeTest(ITestResult iTestResult) {
3434
destroyDriver();
3535
}
3636

37+
@Issue("TAP/API-0001")
38+
@Story("HTTP STATUSES")
3739
@Owner("Kamil Nowocin")
38-
@Test(description = "HTTP status check", priority = 0)
39-
@Description("As a user I would like to check availability of automationpractice.com")
4040
@Severity(SeverityLevel.BLOCKER)
41-
@Issue("TAP-0000")
41+
@Description("[US-XXX]/[1] As a user I would like to check availability of automationpractice.com")
42+
@Test(description = "[US-XXX]/[1] I would like to check availability of automationpractice.com",
43+
priority = 0)
4244
public void test_1() throws Throwable {
4345
//ARRANGE//
4446
ExcelEnvironment.saveTestResultsXLSX(45);

src/test/java/tests/APP/Authentication_Tests.java renamed to src/test/java/tests/WebAPP/Authentication_Tests.java

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tests.APP;
1+
package tests.WebAPP;
22

33
import com.ContextInjection;
44
import com.ExcelEnvironment;
@@ -22,14 +22,13 @@
2222
@Listeners({TestNGListener_WEB.class})
2323
public class Authentication_Tests extends Hooks {
2424

25-
@Owner("Kamil Nowocin")
26-
@Test(priority = 0,
27-
description = "I can log into automationpractice.com using registered email [email protected]")
28-
@Description("As a user I would like to log in automationpractice.com ->\n" +
29-
"I can log into automationpractice.com using registered email [email protected]")
30-
@Severity(SeverityLevel.CRITICAL)
3125
@Issue("TAP-0001")
3226
@Story("POSITIVE FLOW")
27+
@Owner("Kamil Nowocin")
28+
@Severity(SeverityLevel.CRITICAL)
29+
@Description("[US-111]/[1] As a user I can log into automationpractice.com using registered email \"[email protected]\" & password \"12345\"")
30+
@Test(description = "[US-111]/[1] I can log into automationpractice.com using registered email \"[email protected]\" & password \"12345\"",
31+
priority = 0)
3332
public void test_1() throws Throwable {
3433
//ARRANGE//
3534
ExcelEnvironment.saveTestResultsXLSX(1);
@@ -51,14 +50,13 @@ public void test_1() throws Throwable {
5150
registrationPageSteps.iCanSeeWelcomeMessage();
5251
}
5352

54-
@Owner("Kamil Nowocin")
55-
@Test(priority = 0,
56-
description = "I can't log into automationpractice.com using unregistered email [email protected] and wrong password")
57-
@Description("As a user I would like to log in automationpractice.com ->\n" +
58-
"I can't log into automationpractice.com using email [email protected] and wrong password")
59-
@Severity(SeverityLevel.NORMAL)
6053
@Issue("TAP-0002")
6154
@Story("NEGATIVE FLOW")
55+
@Severity(SeverityLevel.NORMAL)
56+
@Owner("Kamil Nowocin")
57+
@Description("[US-111]/[2] As a user I can't log into automationpractice.com using email \"[email protected]\" & password \"12345\"")
58+
@Test(description = "[US-111]/[2] I can't log into automationpractice.com using email \"[email protected]\" & password \"12345\"",
59+
priority = 0)
6260
public void test_2() throws Throwable {
6361
//ARRANGE//
6462
ExcelEnvironment.saveTestResultsXLSX(2);
@@ -80,14 +78,13 @@ public void test_2() throws Throwable {
8078
authenticationPageSteps.iCanSeeWarningMessageWithInclude("Authentication failed");
8179
}
8280

83-
@Owner("Kamil Nowocin")
84-
@Test(priority = 0,
85-
description = "I can't log into automationpractice.com using registered email [email protected] without password")
86-
@Description("As a user I would like to log in automationpractice.com ->\n" +
87-
"I can't log into automationpractice.com using email [email protected] without password")
88-
@Severity(SeverityLevel.NORMAL)
8981
@Issue("TAP-0003")
9082
@Story("NEGATIVE FLOW")
83+
@Owner("Kamil Nowocin")
84+
@Severity(SeverityLevel.NORMAL)
85+
@Description("[US-111]/[2] As a user I can't log into automationpractice.com using email \"[email protected]\" & password \"null\"")
86+
@Test(description = "[US-111]/[3] I can't log into automationpractice.com using email \"[email protected]\" & password \"null\"",
87+
priority = 0)
9188
public void test_3() throws Throwable {
9289
//ARRANGE//
9390
ExcelEnvironment.saveTestResultsXLSX(3);
@@ -109,14 +106,13 @@ public void test_3() throws Throwable {
109106
authenticationPageSteps.iCanSeeWarningMessageWithInclude("Password is required");
110107
}
111108

112-
@Owner("Kamil Nowocin")
113-
@Test(priority = 0,
114-
description = "I can't log into automationpractice.com using email \"null\" with password")
115-
@Description("As a user I would like to log in automationpractice.com ->\n" +
116-
"I can't log into automationpractice.com using email \"null\" with password")
117-
@Severity(SeverityLevel.NORMAL)
118109
@Issue("TAP-0004")
119110
@Story("NEGATIVE FLOW")
111+
@Owner("Kamil Nowocin")
112+
@Severity(SeverityLevel.NORMAL)
113+
@Description("[US-111]/[2] As a user I can't log into automationpractice.com using email \"null\" & password \"12345\"")
114+
@Test(description = "[US-111]/[4] I can't log into automationpractice.com using email \"null\" & password \"12345\"",
115+
priority = 0)
120116
public void test_4() throws Throwable {
121117
//ARRANGE//
122118
ExcelEnvironment.saveTestResultsXLSX(4);

0 commit comments

Comments
 (0)