Skip to content

Commit a9fb8aa

Browse files
author
Kamil Nowocin
committed
feat: Update test traceability
1 parent ab4cd04 commit a9fb8aa

19 files changed

+209
-111
lines changed

src/test/java/com/FrameworkEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class FrameworkEnvironment {
4242
protected static Logger logger = LoggerFactory.getLogger(Hooks.class);
4343
protected static Faker faker = new Faker(new Locale("en-US"));
4444
protected static MockNeat mockNeat = MockNeat.threadLocal();
45-
protected static DecimalFormat decimalFormat = new DecimalFormat("#0.00");
45+
protected static DecimalFormat $decimalFormat = new DecimalFormat("$#0.00");
4646

4747
//BUNDLES//
4848
protected static final ResourceBundle resourceBundleInvalidEmails = ResourceBundle.getBundle("invalidEmails");

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void iChooseFollowingDetailsOfMyOrder(DataTable dataTable) throws Throwab
134134

135135
//INJECTIONS//
136136
contextInjection.productUnitPrice = Double.parseDouble
137-
(productDetailsPage.productPrice.getText().replaceAll("[$]*[^0-9.]", ""));
137+
(productDetailsPage.productPrice.getText().replaceAll("[^0-9.]", ""));
138138
contextInjection.productQuantity = Double.parseDouble(productQuantity);
139139
contextInjection.productSize = productSize;
140140
contextInjection.productColor = productColor;
@@ -168,12 +168,12 @@ public void iCanSeeModalWhereIAmAbleToSeeDetailedDataAboutMyPurchase() throws Th
168168
String.format(VIEW_ERROR, "Product added successfully header"));
169169

170170
Assert.assertEquals(productDetailsPage.popupPaneFinalProductTotalPrice.getText()
171-
.replaceAll("[$]*[^0-9.]", "").replace(".", ","),
172-
decimalFormat.format(contextInjection.finalProductTotalPrice), VALUE_ERROR);
171+
.replaceAll("[^$0-9.]", "").replace(".", ","),
172+
$decimalFormat.format(contextInjection.finalProductTotalPrice), VALUE_ERROR);
173173

174174
Assert.assertEquals(productDetailsPage.popupPaneFinalOrderTotalPrice.getText()
175-
.replaceAll("[$]*[^0-9.]", "").replace(".", ","),
176-
decimalFormat.format(contextInjection.finalOrderTotalPrice), VALUE_ERROR);
175+
.replaceAll("[^$0-9.]", "").replace(".", ","),
176+
$decimalFormat.format(contextInjection.finalOrderTotalPrice), VALUE_ERROR);
177177
}
178178

179179
@Step("I click on Proceed To Checkout button \\(from modal)")
@@ -204,15 +204,15 @@ public void iCanSeeShoppingCartFormWithValidInformation(String shoppingSummaryTa
204204
Assert.assertEquals(shoppingCartSummaryPage.productName.getText().toLowerCase(),
205205
contextInjection.productName.toLowerCase(), VALUE_ERROR);
206206
Assert.assertEquals(Double.parseDouble(shoppingCartSummaryPage.productUnitPrice.getText()
207-
.replaceAll("[$]*[^0-9.]", "")), contextInjection.productUnitPrice, VALUE_ERROR);
207+
.replaceAll("[^0-9.]", "")), contextInjection.productUnitPrice, VALUE_ERROR);
208208
Assert.assertEquals(Double.parseDouble(shoppingCartSummaryPage.productQuantity.getAttribute
209209
("value").toLowerCase()), contextInjection.productQuantity, VALUE_ERROR);
210210
Assert.assertEquals(shoppingCartSummaryPage.productTotalPrice.getText()
211-
.replaceAll("[$]*[^0-9.]", "").replace(".", ","),
212-
decimalFormat.format(contextInjection.finalProductTotalPrice), VALUE_ERROR);
211+
.replaceAll("[^$0-9.]", "").replace(".", ","),
212+
$decimalFormat.format(contextInjection.finalProductTotalPrice), VALUE_ERROR);
213213
//TODO - how tax is calculated in america?
214214
//Assert.assertEquals(shoppingCartSummaryPage.productTotalOrderPriceTAX.getText()
215-
// .replaceAll("[$]*[^0-9.]", "").replace(".", ","),
215+
// .replaceAll("[$]*[^$0-9.]", "").replace(".", ","),
216216
// decimalFormat.format(productTotalOrderPriceWithTax), VALUE_ERROR);
217217
break;
218218

@@ -315,7 +315,7 @@ public void iChooseShippingOption(String shippingOption) throws Throwable {
315315

316316
//ASSERT//
317317
Assert.assertEquals(Double.parseDouble(shoppingCartSummaryPage.readMyCarrierPrice.getText()
318-
.replaceAll("[$]*[^0-9.]", "")), contextInjection.SHIPPING_PRICE, VALUE_ERROR);
318+
.replaceAll("[^0-9.]", "")), contextInjection.SHIPPING_PRICE, VALUE_ERROR);
319319
}
320320

321321
@Step("I click on Terms of Service checkbox")

src/test/java/tests/API_Tests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public void beforeTest(ITestResult iTestResult) {
3838
@Test(description = "HTTP status check", priority = 0)
3939
@Description("As a user I would like to check availability of automationpractice.com")
4040
@Severity(SeverityLevel.BLOCKER)
41-
@Issue("TAP-043")
41+
@Issue("TAP-0000")
4242
public void test_1() throws Throwable {
4343
//ARRANGE//
44-
ExcelEnvironment.saveTestResultsXLSX(44);
44+
ExcelEnvironment.saveTestResultsXLSX(45);
4545

4646
//ACT//
4747
given().when().get(restHomeURL()).then().assertThat().statusCode(200);

src/test/java/tests/Authentication_Tests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public class Authentication_Tests extends Hooks {
2828
@Description("As a user I would like to log in automationpractice.com ->\n" +
2929
"I can log into automationpractice.com using registered email [email protected]")
3030
@Severity(SeverityLevel.CRITICAL)
31-
@Issue("TAP-009")
31+
@Issue("TAP-0001")
3232
@Story("POSITIVE FLOW")
3333
public void test_1() throws Throwable {
3434
//ARRANGE//
35-
ExcelEnvironment.saveTestResultsXLSX(9);
35+
ExcelEnvironment.saveTestResultsXLSX(1);
3636

3737
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
3838
final RegistrationPageSteps registrationPageSteps = new RegistrationPageSteps(new ContextInjection());
@@ -57,11 +57,11 @@ public void test_1() throws Throwable {
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")
5959
@Severity(SeverityLevel.CRITICAL)
60-
@Issue("TAP-010")
60+
@Issue("TAP-0002")
6161
@Story("NEGATIVE FLOW")
6262
public void test_2() throws Throwable {
6363
//ARRANGE//
64-
ExcelEnvironment.saveTestResultsXLSX(10);
64+
ExcelEnvironment.saveTestResultsXLSX(2);
6565

6666
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
6767
final RegistrationPageSteps registrationPageSteps = new RegistrationPageSteps(new ContextInjection());
@@ -86,11 +86,11 @@ public void test_2() throws Throwable {
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")
8888
@Severity(SeverityLevel.CRITICAL)
89-
@Issue("TAP-011")
89+
@Issue("TAP-0003")
9090
@Story("NEGATIVE FLOW")
9191
public void test_3() throws Throwable {
9292
//ARRANGE//
93-
ExcelEnvironment.saveTestResultsXLSX(11);
93+
ExcelEnvironment.saveTestResultsXLSX(3);
9494

9595
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
9696
final RegistrationPageSteps registrationPageSteps = new RegistrationPageSteps(new ContextInjection());
@@ -115,11 +115,11 @@ public void test_3() throws Throwable {
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")
117117
@Severity(SeverityLevel.CRITICAL)
118-
@Issue("TAP-012")
118+
@Issue("TAP-0004")
119119
@Story("NEGATIVE FLOW")
120120
public void test_4() throws Throwable {
121121
//ARRANGE//
122-
ExcelEnvironment.saveTestResultsXLSX(12);
122+
ExcelEnvironment.saveTestResultsXLSX(4);
123123

124124
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
125125
final RegistrationPageSteps registrationPageSteps = new RegistrationPageSteps(new ContextInjection());

src/test/java/tests/CustomerService_Tests.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public class CustomerService_Tests extends Hooks {
2727
@Description("As a user I would like to contact with customer service support ->\n" +
2828
"I will send request via contact us form, all inputs are filled up")
2929
@Severity(SeverityLevel.NORMAL)
30-
@Issue("TAP-001")
30+
@Issue("TAP-0005")
3131
@Story("POSITIVE FLOW")
3232
public void test_1() throws Throwable {
3333
//ARRANGE//
34-
ExcelEnvironment.saveTestResultsXLSX(1);
34+
ExcelEnvironment.saveTestResultsXLSX(5);
3535

3636

3737
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
@@ -59,11 +59,11 @@ public void test_1() throws Throwable {
5959
@Description("As a user I would like to contact with customer service support ->\n" +
6060
"I will send request via contact us form, all required inputs are filled up")
6161
@Severity(SeverityLevel.NORMAL)
62-
@Issue("TAP-002")
62+
@Issue("TAP-0006")
6363
@Story("POSITIVE FLOW")
6464
public void test_2() throws Throwable {
6565
//ARRANGE//
66-
ExcelEnvironment.saveTestResultsXLSX(2);
66+
ExcelEnvironment.saveTestResultsXLSX(6);
6767

6868
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
6969
final CustomerServicePageSteps customerServicePageSteps = new CustomerServicePageSteps();
@@ -89,11 +89,11 @@ public void test_2() throws Throwable {
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")
9191
@Severity(SeverityLevel.NORMAL)
92-
@Issue("TAP-003")
92+
@Issue("TAP-0007")
9393
@Story("POSITIVE FLOW")
9494
public void test_3() throws Throwable {
9595
//ARRANGE//
96-
ExcelEnvironment.saveTestResultsXLSX(3);
96+
ExcelEnvironment.saveTestResultsXLSX(7);
9797

9898
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
9999
final CustomerServicePageSteps customerServicePageSteps = new CustomerServicePageSteps();
@@ -121,11 +121,11 @@ public void test_3() throws Throwable {
121121
@Description("As a user I would like to contact with customer service support ->\n" +
122122
"I will send request via contact us form, email input is invalid")
123123
@Severity(SeverityLevel.NORMAL)
124-
@Issue("TAP-004")
124+
@Issue("TAP-0008")
125125
@Story("NEGATIVE FLOW")
126126
public void test_4() throws Throwable {
127127
//ARRANGE//
128-
ExcelEnvironment.saveTestResultsXLSX(4);
128+
ExcelEnvironment.saveTestResultsXLSX(8);
129129

130130
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
131131
final CustomerServicePageSteps customerServicePageSteps = new CustomerServicePageSteps();
@@ -153,11 +153,11 @@ public void test_4() throws Throwable {
153153
@Description("As a user I would like to contact with customer service support ->\n" +
154154
"I will send request via contact us form, subject is missing")
155155
@Severity(SeverityLevel.NORMAL)
156-
@Issue("TAP-005")
156+
@Issue("TAP-0009")
157157
@Story("NEGATIVE FLOW")
158158
public void test_5() throws Throwable {
159159
//ARRANGE//
160-
ExcelEnvironment.saveTestResultsXLSX(5);
160+
ExcelEnvironment.saveTestResultsXLSX(9);
161161

162162
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
163163
final CustomerServicePageSteps customerServicePageSteps = new CustomerServicePageSteps();
@@ -185,11 +185,11 @@ public void test_5() throws Throwable {
185185
@Description("As a user I would like to contact with customer service support ->\n" +
186186
"I will send request via contact us form, email address is missing")
187187
@Severity(SeverityLevel.NORMAL)
188-
@Issue("TAP-006")
188+
@Issue("TAP-0010")
189189
@Story("NEGATIVE FLOW")
190190
public void test_6() throws Throwable {
191191
//ARRANGE//
192-
ExcelEnvironment.saveTestResultsXLSX(6);
192+
ExcelEnvironment.saveTestResultsXLSX(10);
193193

194194
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
195195
final CustomerServicePageSteps customerServicePageSteps = new CustomerServicePageSteps();
@@ -217,11 +217,11 @@ public void test_6() throws Throwable {
217217
@Description("As a user I would like to contact with customer service support ->\n" +
218218
"I will send request via contact us form, message input is missing")
219219
@Severity(SeverityLevel.NORMAL)
220-
@Issue("TAP-007")
220+
@Issue("TAP-0011")
221221
@Story("NEGATIVE FLOW")
222222
public void test_7() throws Throwable {
223223
//ARRANGE//
224-
ExcelEnvironment.saveTestResultsXLSX(7);
224+
ExcelEnvironment.saveTestResultsXLSX(11);
225225

226226
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
227227
final CustomerServicePageSteps customerServicePageSteps = new CustomerServicePageSteps();
@@ -249,11 +249,11 @@ public void test_7() throws Throwable {
249249
@Description("As a user I would like to contact with customer service support ->\n" +
250250
"I will send request via contact us form, all inputs are missing")
251251
@Severity(SeverityLevel.NORMAL)
252-
@Issue("TAP-008")
252+
@Issue("TAP-0012")
253253
@Story("NEGATIVE FLOW")
254254
public void test_8() throws Throwable {
255255
//ARRANGE//
256-
ExcelEnvironment.saveTestResultsXLSX(8);
256+
ExcelEnvironment.saveTestResultsXLSX(12);
257257

258258
final MainPageSteps mainPageSteps = new MainPageSteps(new ContextInjection());
259259
final CustomerServicePageSteps customerServicePageSteps = new CustomerServicePageSteps();

src/test/java/tests/POC_Tests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@Ignore
1818
@Epic("POC Tests")
1919
@Feature("POC Tests")
20-
//@Listeners({TestNGListener_WEB.class})
20+
//@Listeners({TestNGListener_WEB.class}) //ENABLE TO SAVE RESULTS IN EXCEL
2121
public class POC_Tests extends Hooks {
2222

2323
@Step("Some POC step")
@@ -36,7 +36,7 @@ public void testSteps(XSSFRow row) {
3636
@Story("POC Tests")
3737
public void excelTest() throws Throwable {
3838
//ARRANGE//
39-
ExcelEnvironment.saveTestResultsXLSX(1);
39+
ExcelEnvironment.saveTestResultsXLSX(50);
4040

4141
//ACT//
4242
testSteps(ExcelEnvironment.getRowData(1));

src/test/java/tests/RegistrationValidators_Tests.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class RegistrationValidators_Tests extends Hooks {
2727
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
2828
"I would like to see registration error, when I don't fill first name input")
2929
@Severity(SeverityLevel.NORMAL)
30-
@Issue("TAP-020")
30+
@Issue("TAP-0020")
3131
@Story("NEGATIVE FLOW")
3232
public void test_1() throws Throwable {
3333
//ARRANGE//
@@ -66,7 +66,7 @@ public void test_1() throws Throwable {
6666
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
6767
"I would like to see registration error, when I don't fill last name input")
6868
@Severity(SeverityLevel.NORMAL)
69-
@Issue("TAP-021")
69+
@Issue("TAP-0021")
7070
@Story("NEGATIVE FLOW")
7171
public void test_2() throws Throwable {
7272
//ARRANGE//
@@ -105,7 +105,7 @@ public void test_2() throws Throwable {
105105
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
106106
"I would like to see registration error, when I don't fill email input")
107107
@Severity(SeverityLevel.NORMAL)
108-
@Issue("TAP-022")
108+
@Issue("TAP-0022")
109109
@Story("NEGATIVE FLOW")
110110
public void test_3() throws Throwable {
111111
//ARRANGE//
@@ -146,7 +146,7 @@ public void test_3() throws Throwable {
146146
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
147147
"I would like to see registration error, when I don't fill password input")
148148
@Severity(SeverityLevel.NORMAL)
149-
@Issue("TAP-023")
149+
@Issue("TAP-0023")
150150
@Story("NEGATIVE FLOW")
151151
public void test_4() throws Throwable {
152152
//ARRANGE//
@@ -185,7 +185,7 @@ public void test_4() throws Throwable {
185185
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
186186
"I would like to see registration error, when I don't fill address input")
187187
@Severity(SeverityLevel.NORMAL)
188-
@Issue("TAP-024")
188+
@Issue("TAP-0024")
189189
@Story("NEGATIVE FLOW")
190190
public void test_5() throws Throwable {
191191
//ARRANGE//
@@ -224,7 +224,7 @@ public void test_5() throws Throwable {
224224
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
225225
"I would like to see registration error, when I don't fill city input")
226226
@Severity(SeverityLevel.NORMAL)
227-
@Issue("TAP-025")
227+
@Issue("TAP-0025")
228228
@Story("NEGATIVE FLOW")
229229
public void test_6() throws Throwable {
230230
//ARRANGE//
@@ -263,7 +263,7 @@ public void test_6() throws Throwable {
263263
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
264264
"I would like to see registration error, when I don't fill state input")
265265
@Severity(SeverityLevel.NORMAL)
266-
@Issue("TAP-026")
266+
@Issue("TAP-0026")
267267
@Story("NEGATIVE FLOW")
268268
public void test_7() throws Throwable {
269269
//ARRANGE//
@@ -302,7 +302,7 @@ public void test_7() throws Throwable {
302302
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
303303
"I would like to see registration error, when I don't fill postal code input")
304304
@Severity(SeverityLevel.NORMAL)
305-
@Issue("TAP-027")
305+
@Issue("TAP-0027")
306306
@Story("NEGATIVE FLOW")
307307
public void test_8() throws Throwable {
308308
//ARRANGE//
@@ -341,7 +341,7 @@ public void test_8() throws Throwable {
341341
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
342342
"I would like to see registration error, when I don't fill country input")
343343
@Severity(SeverityLevel.NORMAL)
344-
@Issue("TAP-028")
344+
@Issue("TAP-0028")
345345
@Story("NEGATIVE FLOW")
346346
public void test_9() throws Throwable {
347347
//ARRANGE//
@@ -379,7 +379,7 @@ public void test_9() throws Throwable {
379379
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
380380
"I would like to see registration error, when I don't fill mobile phone input")
381381
@Severity(SeverityLevel.NORMAL)
382-
@Issue("TAP-029")
382+
@Issue("TAP-0029")
383383
@Story("NEGATIVE FLOW")
384384
public void test_10() throws Throwable {
385385
//ARRANGE//
@@ -418,7 +418,7 @@ public void test_10() throws Throwable {
418418
@Description("As a user I would like to see the error message where I made a mistake in the registration page form ->\n" +
419419
"I would like to see registration error, when I don't fill email alias address input")
420420
@Severity(SeverityLevel.NORMAL)
421-
@Issue("TAP-030")
421+
@Issue("TAP-0030")
422422
@Story("NEGATIVE FLOW")
423423
public void test_11() throws Throwable {
424424
//ARRANGE//

0 commit comments

Comments
 (0)