Skip to content

Commit 86c6cd4

Browse files
author
Kamil Nowocin
committed
feat: Build tweaks
1 parent db607a7 commit 86c6cd4

16 files changed

+167
-133
lines changed

README.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
11
![Imgur](https://imgur.com/SeGMpNV.png)
2-
![](https://img.shields.io/badge/language-java-critical)
3-
![](https://img.shields.io/badge/Allure%20Report-2.8.1-orange.svg)
4-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5-
[![Build Status](https://travis-ci.com/kamil-nowocin/Test_Automation-automationpractice.svg?branch=master)](https://travis-ci.com/kamil-nowocin/Test_Automation-automationpractice)
6-
![GitHub last commit](https://img.shields.io/github/last-commit/kamil-nowocin/Test_Automation-automationpractice)
7-
![GitHub release (latest by date)](https://img.shields.io/github/v/release/kamil-nowocin/Test_Automation-automationpractice)
8-
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/kamil-nowocin/Test_Automation-automationpractice)
2+
![JAVA](https://img.shields.io/badge/language-java-critical?style=flat-square)
3+
![ALLURE](https://img.shields.io/badge/Allure%20Report-2.8.1-orange.svg?style=flat-square)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
5+
[![Build Status](https://img.shields.io/travis/kamil-nowocin/Test_Automation-automationpractice/master.svg?style=flat-square)](https://travis-ci.com/kamil-nowocin/Test_Automation-automationpractice)
6+
![GitHub last commit](https://img.shields.io/github/last-commit/kamil-nowocin/Test_Automation-automationpractice?style=flat-square)
7+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/kamil-nowocin/Test_Automation-automationpractice?style=flat-square)
8+
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/kamil-nowocin/Test_Automation-automationpractice?style=flat-square)
9+
[![LinkedIn](https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555)](https://linkedin.com/in/kamil-nowocin)
910
# Test automation - http://www.automationpractice.com
1011
**Design Pattern:** Page Object Model & AAA
1112
**Following tools were used in this framework:**
1213
Java, TestNG, REST Assured, Selenium, Gradle, Cucumber, WebDriverManager, Faker & MockNeat, Travis CI, BrowserStack, Allure Reports, GitHub Pages
1314
## ABOUT PROJECT
1415
Project made in my spare time to develop my skills in automation testing.
1516
You don't have to download any WebDrivers - I'm using WebDriverManager, drivers will be downloaded by gradle.
16-
Supported browsers aka hosts:
17+
Supported browsers aka hosts:
1718
* *Chrome*
1819
* *Firefox*
1920
* *Opera*
20-
* *Safari*
2121
* *Edge*
22+
* *Internet Explorer*
23+
* *Safari*
2224
## FEATURES
23-
Framework now support .xlsx files. You can easily change test style to DDT.
24-
## TEST REPORTS & LOGS
25-
After each CI/CD test run, tests results are automatically transfered to [kamil-nowocin.github.io](https://kamil-nowocin.github.io/Test_Automation-automationpractice/)
26-
Local test results are stored in build/allure-report. In terminal type `allure generate build/allure-report --clean`
27-
Local logs are stored separately in logs directory, for each tests case. Logs will be deleted when you launch new test run.
28-
Local logs are also stored in files directory, they are saved into testData.xlsx
29-
## HOW TO RUN
25+
* Support for WebDriverManager
26+
* Support for Allure Report
27+
* Support for .xlsx files
28+
* Support for Fake & Mock data
29+
## 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 LOCAL cycle run, tests results will be stored in build/allure-report.
32+
In terminal type `allure generate build/allure-report --clean` to generate local Allure Test Results
33+
##LOGS
34+
There are two types of log information saved after each test run:
35+
* Detailed logs in log directory. Warning! These logs will be deleted when you launch new test run.
36+
* 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>
37+
## HOW TO RUN TESTS
3038
There are multiple ways to run tests from this build. It all depends on what you want to do:
3139
1. Right click on `.feature` file, and Run -> This will run `.feature` file on default settings.
3240
2. Right click on `TestNGRunner` file, and Run -> This will run all `.feature` files on default settings.

src/test/java/com/steps/MainPageSteps.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void iCanSeeAutomationpracticeComWebsite() throws Throwable {
5757
Assert.assertTrue(isPageReadyToExecuteTests, PAGE_ERROR);
5858
}
5959

60-
@Step("I am logged as customer *{0}* using *{0}* password")
60+
@Step("I am logged as customer *{0}* using *{1}* password")
6161
@When("I am logged as customer {string} using {string} password")
6262
public void iAmLoggedAsCustomerUsingPassword(String email, String password) throws Throwable {
6363
//ARRANGE//

src/test/java/tests/APP/Authentication_Tests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void test_1() throws Throwable {
5656
description = "I can't log into automationpractice.com using unregistered email [email protected] and wrong password")
5757
@Description("As a user I would like to log in automationpractice.com ->\n" +
5858
"I can't log into automationpractice.com using email [email protected] and wrong password")
59-
@Severity(SeverityLevel.CRITICAL)
59+
@Severity(SeverityLevel.NORMAL)
6060
@Issue("TAP-0002")
6161
@Story("NEGATIVE FLOW")
6262
public void test_2() throws Throwable {
@@ -85,7 +85,7 @@ public void test_2() throws Throwable {
8585
description = "I can't log into automationpractice.com using registered email [email protected] without password")
8686
@Description("As a user I would like to log in automationpractice.com ->\n" +
8787
"I can't log into automationpractice.com using email [email protected] without password")
88-
@Severity(SeverityLevel.CRITICAL)
88+
@Severity(SeverityLevel.NORMAL)
8989
@Issue("TAP-0003")
9090
@Story("NEGATIVE FLOW")
9191
public void test_3() throws Throwable {
@@ -114,7 +114,7 @@ public void test_3() throws Throwable {
114114
description = "I can't log into automationpractice.com using email \"null\" with password")
115115
@Description("As a user I would like to log in automationpractice.com ->\n" +
116116
"I can't log into automationpractice.com using email \"null\" with password")
117-
@Severity(SeverityLevel.CRITICAL)
117+
@Severity(SeverityLevel.NORMAL)
118118
@Issue("TAP-0004")
119119
@Story("NEGATIVE FLOW")
120120
public void test_4() throws Throwable {

src/test/java/tests/APP/CustomerService_Tests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void test_2() throws Throwable {
8888
description = "I am able to send request via contact us form witch attached file")
8989
@Description("As a user I would like to contact with customer service support ->\n" +
9090
"I will send request via contact us form witch attached file")
91-
@Severity(SeverityLevel.NORMAL)
91+
@Severity(SeverityLevel.CRITICAL)
9292
@Issue("TAP-0007")
9393
@Story("POSITIVE FLOW")
9494
public void test_3() throws Throwable {

src/test/java/tests/APP/Registration_Tests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void test_2() throws Throwable {
103103
description = "I can create an account by filling up only required fields")
104104
@Description("As a user I would like to register into automationpractice.com ->\n" +
105105
"I can create an account by filling up only required fields")
106-
@Severity(SeverityLevel.BLOCKER)
106+
@Severity(SeverityLevel.CRITICAL)
107107
@Issue("TAP-0015")
108108
@Story("POSITIVE FLOW")
109109
public void test_3() throws Throwable {
@@ -144,7 +144,7 @@ public void test_3() throws Throwable {
144144
description = "I can't create an account without filling up fields")
145145
@Description("As a user I would like to register into automationpractice.com ->\n" +
146146
"I can't create an account without filling up fields")
147-
@Severity(SeverityLevel.CRITICAL)
147+
@Severity(SeverityLevel.NORMAL)
148148
@Issue("TAP-0016")
149149
@Story("NEGATIVE FLOW")
150150
public void test_4() throws Throwable {
@@ -172,7 +172,7 @@ public void test_4() throws Throwable {
172172
description = "I can't create an account, when one of required fields is missing")
173173
@Description("As a user I would like to register into automationpractice.com ->\n" +
174174
"I can't create an account, when one of required fields is missing")
175-
@Severity(SeverityLevel.CRITICAL)
175+
@Severity(SeverityLevel.NORMAL)
176176
@Issue("TAP-0017")
177177
@Story("NEGATIVE FLOW")
178178
public void test_5() throws Throwable {

src/test/java/tests/APP/SearchBox_Tests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class SearchBox_Tests extends Hooks {
2626
description = "I would like to use search box and be able to see results of: \"T-Shirts\"")
2727
@Description("A a user I would like to see results of searching phrase ->\n" +
2828
"I would like to use search box and be able to see results of: \"T-Shirts\"")
29-
@Severity(SeverityLevel.NORMAL)
29+
@Severity(SeverityLevel.CRITICAL)
3030
@Issue("TAP-0031")
3131
@Story("POSITIVE FLOW")
3232
public void test_1() throws Throwable {
@@ -52,7 +52,7 @@ public void test_1() throws Throwable {
5252
description = "I would like to use search box and be able to see results of: \"Blouse\" ")
5353
@Description("A a user I would like to see results of searching phrase ->\n" +
5454
"I would like to use search box and be able to see results of: \"Blouse\"")
55-
@Severity(SeverityLevel.NORMAL)
55+
@Severity(SeverityLevel.CRITICAL)
5656
@Issue("TAP-0032")
5757
@Story("POSITIVE FLOW")
5858
public void test_2() throws Throwable {
@@ -78,7 +78,7 @@ public void test_2() throws Throwable {
7878
description = "I would like to use search box and be able to see results of: \"Printed Dress\"")
7979
@Description("A a user I would like to see results of searching phrase ->\n" +
8080
"I would like to use search box and be able to see results of: \"Printed Dress\"")
81-
@Severity(SeverityLevel.NORMAL)
81+
@Severity(SeverityLevel.CRITICAL)
8282
@Issue("TAP-0033")
8383
@Story("POSITIVE FLOW")
8484
public void test_3() throws Throwable {
@@ -104,7 +104,7 @@ public void test_3() throws Throwable {
104104
description = "I would like to use search box and be able to see results of: \"UNDEFINED PRODUCT\"")
105105
@Description("A a user I would like to see results of searching phrase ->\n" +
106106
"I would like to use search box and be able to see results of: \"UNDEFINED PRODUCT\"")
107-
@Severity(SeverityLevel.NORMAL)
107+
@Severity(SeverityLevel.CRITICAL)
108108
@Issue("TAP-0034")
109109
@Story("NEGATIVE FLOW")
110110
public void test_4() throws Throwable {
@@ -130,7 +130,7 @@ public void test_4() throws Throwable {
130130
description = "I would like to use search box and be able to see sorted results by: \"Product Name: Z to A\"")
131131
@Description("A a user I would like to see results of searching phrase ->\n" +
132132
"I would like to use search box and be able to see sorted results by: \"Product Name: Z to A\"")
133-
@Severity(SeverityLevel.NORMAL)
133+
@Severity(SeverityLevel.CRITICAL)
134134
@Issue("TAP-0035")
135135
@Story("POSITIVE FLOW")
136136
public void test_5() throws Throwable {
@@ -158,7 +158,7 @@ public void test_5() throws Throwable {
158158
description = "I would like to use search box and be able to see sorted results by: \"Product Name: A to Z\"")
159159
@Description("A a user I would like to see results of searching phrase ->\n" +
160160
"I would like to use search box and be able to see sorted results by: \"Product Name: A to Z\"")
161-
@Severity(SeverityLevel.NORMAL)
161+
@Severity(SeverityLevel.CRITICAL)
162162
@Issue("TAP-0036")
163163
@Story("POSITIVE FLOW")
164164
public void test_6() throws Throwable {
@@ -187,7 +187,7 @@ public void test_6() throws Throwable {
187187
description = "I would like to use search box and be able to see sorted results by: \"Price: Highest first\"")
188188
@Description("A a user I would like to see results of searching phrase ->\n" +
189189
"I would like to use search box and be able to see sorted results by: \"Price: Highest first\"")
190-
@Severity(SeverityLevel.NORMAL)
190+
@Severity(SeverityLevel.CRITICAL)
191191
@Issue("TAP-0037")
192192
@Story("POSITIVE FLOW")
193193
public void test_7() throws Throwable {
@@ -215,7 +215,7 @@ public void test_7() throws Throwable {
215215
description = "I would like to use search box and be able to see sorted results by: \"Price: Lowest first\"")
216216
@Description("A a user I would like to see results of searching phrase ->\n" +
217217
"I would like to use search box and be able to see sorted results by: \"Price: Lowest first\"")
218-
@Severity(SeverityLevel.NORMAL)
218+
@Severity(SeverityLevel.CRITICAL)
219219
@Issue("TAP-0038")
220220
@Story("POSITIVE FLOW")
221221
@Flaky

src/test/java/tests/APP/ShoppingLoggedUser_Tests.java

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,62 @@ public void test_1() throws Throwable {
8484
//ASSERT
8585
shoppingLoggedUserSteps.iCanSeeShoppingCartFormWithValidInformation("Order confirmation");
8686
}
87+
88+
@Owner("Kamil Nowocin")
89+
@Test(priority = 0,
90+
description = "I would like to buy new Blouse from automationpractice.com")
91+
@Description("(User is already successfully logged) As a user I would like to buy new clothes from automationpractice.com ->\n" +
92+
"I would like to buy new \"Blouse\"")
93+
@Severity(SeverityLevel.CRITICAL)
94+
@Issue("TAP-0040")
95+
@Story("POSITIVE FLOW")
96+
public void test_2() throws Throwable {
97+
//ARRANGE//
98+
ExcelEnvironment.saveTestResultsXLSX(40);
99+
List<List<String>> orderDetails = Arrays.asList
100+
(
101+
Arrays.asList("Quantity", " Size", "Colour"),
102+
Arrays.asList("2", "S", "Black")
103+
);
104+
DataTable orderDetailsDataTable = DataTable.create(orderDetails);
105+
106+
List<List<String>> paymentDetails = Arrays.asList
107+
(
108+
Collections.singletonList("Payment Method"),
109+
Collections.singletonList("Pay by bank wire")
110+
);
111+
DataTable paymentDetailsDataTable = DataTable.create(paymentDetails);
112+
113+
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
114+
final RegistrationPageSteps registrationPageSteps = new RegistrationPageSteps(new ContextInjection());
115+
final ShoppingLoggedUserSteps shoppingLoggedUserSteps = new ShoppingLoggedUserSteps(new ContextInjection());
116+
117+
//ACT//
118+
mainPageSteps.iOpenHomePage();
119+
mainPageSteps.iCanSeeAutomationpracticeComWebsite();
120+
mainPageSteps.iAmLoggedAsCustomerUsingPassword("[email protected]", "12345");
121+
registrationPageSteps.iCanSeeWelcomeMessage();
122+
mainPageSteps.iAmOnMyAccountDetailsPage();
123+
shoppingLoggedUserSteps.iClickOnButtonFromSubMenu("Women");
124+
shoppingLoggedUserSteps.iClickOnFollowingProduct("Blouse");
125+
shoppingLoggedUserSteps.iChooseFollowingDetailsOfMyOrder(orderDetailsDataTable);
126+
shoppingLoggedUserSteps.iClickOnAddToCartButton();
127+
shoppingLoggedUserSteps.iCanSeeModalWhereIAmAbleToSeeDetailedDataAboutMyPurchase();
128+
shoppingLoggedUserSteps.iClickOnProceedToCheckoutButtonFromModal();
129+
shoppingLoggedUserSteps.iCanSeeShoppingCartFormWithValidInformation("Your shopping cart");
130+
shoppingLoggedUserSteps.iClickOnProceedToCheckoutButtonFromShoppingCart();
131+
shoppingLoggedUserSteps.iCanSeeShoppingCartFormWithValidInformation("Addresses");
132+
shoppingLoggedUserSteps.iWriteCommentAboutMyOrder();
133+
shoppingLoggedUserSteps.iClickOnProceedToCheckoutButtonFromShoppingCart();
134+
shoppingLoggedUserSteps.iCanSeeShoppingCartFormWithValidInformation("Shipping");
135+
shoppingLoggedUserSteps.iChooseShippingOption("My carrier");
136+
shoppingLoggedUserSteps.iClickOnTermsOfServiceCheckbox();
137+
shoppingLoggedUserSteps.iClickOnProceedToCheckoutButtonFromShoppingCart();
138+
shoppingLoggedUserSteps.iCanSeeShoppingCartFormWithValidInformation("Your payment method");
139+
shoppingLoggedUserSteps.iChoosePaymentMethod(paymentDetailsDataTable);
140+
shoppingLoggedUserSteps.iClickOnIConfirmMyOrderButton();
141+
142+
//ASSERT
143+
shoppingLoggedUserSteps.iCanSeeShoppingCartFormWithValidInformation("Order confirmation");
144+
}
87145
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public class POC_Tests extends Hooks {
2222

2323
@Step("Some POC step")
2424
public void testSteps(XSSFRow row) {
25-
System.out.println("DATA SET 1: " + row.getCell(12).toString());
26-
System.out.println("DATA SET 2: " + row.getCell(14).toString());
25+
System.out.println("DATA SET 1: " + row.getCell(5).toString());
26+
System.out.println("DATA SET 2: " + row.getCell(7).toString());
2727
}
2828

2929
@Ignore

src/test/resources/features/Authentication.feature

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
@authentication
88
Feature: As a user I would like to log in automationpractice.com
99
#--------------------------------------------------------------------------------#
10-
# [US] https://tracker.FAKE.com/jira/browse/AUTOMATION_PRACTICE-1111 #
10+
# [US] https://tracker.FAKE.com/jira/browse/AUTOMATION_PRACTICE-111 #
1111
#--------------------------------------------------------------------------------#
1212

1313
Background: Navigate to Login page
@@ -17,9 +17,8 @@ Feature: As a user I would like to log in automationpractice.com
1717

1818
#--------------------------------------------------------------------------------#
1919
# [ZEPHYR] https://tracker.FAKE.com/jira/browse/AUTOMATION_PRACTICE-0001
20-
2120
@smoke @critical @regression
22-
Scenario:[1] As a user I can log into automationpractice.com using registered email "[email protected]"
21+
Scenario:[US-111]/[1] As a user I can log into automationpractice.com using registered email "[email protected]"
2322
Given I can see login form
2423
When I enter login "[email protected]"
2524
And I enter password "12345"
@@ -30,9 +29,8 @@ Feature: As a user I would like to log in automationpractice.com
3029
# [ZEPHYR] https://tracker.FAKE.com/jira/browse/AUTOMATION_PRACTICE-0002
3130
# [ZEPHYR] https://tracker.FAKE.com/jira/browse/AUTOMATION_PRACTICE-0003
3231
# [ZEPHYR] https://tracker.FAKE.com/jira/browse/AUTOMATION_PRACTICE-0004
33-
34-
@non-smoke @major @regression
35-
Scenario Outline:[2] As a user I can't log into automationpractice.com using email: <email>
32+
@non-smoke @normal @regression
33+
Scenario Outline:[US-111]/[2] As a user I can't log into automationpractice.com using email: <email>
3634
Given I can see login form
3735
When I enter login "<email>"
3836
And I enter password "<password>"

0 commit comments

Comments
 (0)