Skip to content

Commit

Permalink
Merge pull request #58 from AbuBakkar32/abu-bakkar
Browse files Browse the repository at this point in the history
Abu bakkar
  • Loading branch information
AbuBakkar32 authored Jul 14, 2024
2 parents 4ab28f8 + 299a9c0 commit ae49659
Show file tree
Hide file tree
Showing 30 changed files with 308 additions and 188 deletions.
20 changes: 10 additions & 10 deletions cypress/reports/.jsons/mochawesome.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"passes": 1,
"pending": 0,
"failures": 0,
"start": "2024-07-12T15:59:28.608Z",
"end": "2024-07-12T16:01:07.470Z",
"duration": 98862,
"start": "2024-07-14T04:15:44.851Z",
"end": "2024-07-14T04:16:12.618Z",
"duration": 27767,
"testsRegistered": 1,
"passPercent": 100,
"pendingPercent": 0,
Expand All @@ -18,7 +18,7 @@
},
"results": [
{
"uuid": "932ae15f-17e3-4806-bb7d-91949972fe8a",
"uuid": "f9f78dc7-33e3-4f68-8555-e9fb758993e3",
"title": "",
"fullFile": "cypress\\e2e\\add_product_cart.cy.js",
"file": "cypress\\e2e\\add_product_cart.cy.js",
Expand All @@ -27,7 +27,7 @@
"tests": [],
"suites": [
{
"uuid": "4ab2f413-ea98-4d34-80de-1cbf9da430c5",
"uuid": "75a97583-f455-42fb-8c66-a3b313db5a82",
"title": "Test Case 12: Add Products in Cart",
"fullFile": "",
"file": "",
Expand All @@ -38,7 +38,7 @@
"title": "Add Products in Cart",
"fullTitle": "Test Case 12: Add Products in Cart Add Products in Cart",
"timedOut": null,
"duration": 91159,
"duration": 17875,
"state": "passed",
"speed": "slow",
"pass": true,
Expand All @@ -47,20 +47,20 @@
"context": null,
"code": "// Step 1: Launch browser\n// Cypress automatically launches the browser\n// Step 2: Navigate to url 'http://automationexercise.com'\ncy.visit('http://automationexercise.com');\n// Step 3: Verify that home page is visible successfully\ncy.url().should('include', 'automationexercise');\n// Step 4: Click 'Products' button\ncy.get('#header > div > div > div > div.col-sm-8 > div > ul > li:nth-child(2) > a').click();\n// Step 5: Hover over first product and click 'Add to cart'\ncy.xpath('/html/body/section[2]/div/div/div[2]/div/div[2]/div/div[1]').trigger('mouseover').xpath('/html/body/section[2]/div/div/div[2]/div/div[2]/div/div[1]/div[1]/a').click();\n// Step 6: Click 'Continue Shopping' button\ncy.get('#cartModal > div > div > div.modal-footer > button').click();\n// Step 7: Hover over second product and click 'Add to cart'\ncy.xpath('/html/body/section[2]/div/div/div[2]/div/div[3]/div/div[1]').trigger('mouseover').xpath('/html/body/section[2]/div/div/div[2]/div/div[3]/div/div[1]/div[1]/a').click();\ncy.get('#cartModal > div > div > div.modal-footer > button').click();\n// Step 8: Click 'View Cart' button\ncy.get('#header > div > div > div > div.col-sm-8 > div > ul > li:nth-child(3) > a').click();\n// Step 9: Verify both products are added to Cart\ncy.get('#cart_info_table > tbody').find('.cart_product').should('have.length', 2);\n// Step 10: Verify their prices, quantity and total price\n// Assuming each product has a 'price' class and the total price has a 'total-price' class\ncy.get('tbody > tr').each($el => {\n const price = parseFloat($el.find('.cart_price').text().replace(/[^0-9.-]+/g, \"\")) * 1000;\n const quantity = parseInt($el.find('.cart_quantity').text());\n const totalPrice = price * quantity;\n // Find total price of each product and match is equal to price * quantity\n const total = parseFloat($el.find('.cart_total_price').text().replace(/[^0-9.-]+/g, \"\")) * 1000;\n expect(total).to.equal(totalPrice);\n});",
"err": {},
"uuid": "f92c5314-d917-42c0-837f-cae2afed2bd9",
"parentUUID": "4ab2f413-ea98-4d34-80de-1cbf9da430c5",
"uuid": "c7819ad9-250c-4282-981c-b6fa02840c13",
"parentUUID": "75a97583-f455-42fb-8c66-a3b313db5a82",
"isHook": false,
"skipped": false
}
],
"suites": [],
"passes": [
"f92c5314-d917-42c0-837f-cae2afed2bd9"
"c7819ad9-250c-4282-981c-b6fa02840c13"
],
"failures": [],
"pending": [],
"skipped": [],
"duration": 91159,
"duration": 17875,
"root": false,
"rootEmpty": false,
"_timeout": 2000
Expand Down
20 changes: 10 additions & 10 deletions cypress/reports/.jsons/mochawesome_001.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"passes": 1,
"pending": 0,
"failures": 0,
"start": "2024-07-12T16:01:14.001Z",
"end": "2024-07-12T16:04:02.878Z",
"duration": 168877,
"start": "2024-07-14T04:16:25.706Z",
"end": "2024-07-14T04:17:02.088Z",
"duration": 36382,
"testsRegistered": 1,
"passPercent": 100,
"pendingPercent": 0,
Expand All @@ -18,7 +18,7 @@
},
"results": [
{
"uuid": "b5df6c14-2913-4087-a11f-de98f3394307",
"uuid": "fff1f5ab-f8ff-49cc-b131-00bcee1a767a",
"title": "",
"fullFile": "cypress\\e2e\\add_review_on_product.cy.js",
"file": "cypress\\e2e\\add_review_on_product.cy.js",
Expand All @@ -27,7 +27,7 @@
"tests": [],
"suites": [
{
"uuid": "ac6cd77e-71ff-4cc8-9d78-29df9affe268",
"uuid": "c96ca9b3-0c1c-4200-abe1-ebccebfcc0fc",
"title": "Add review on product",
"fullFile": "",
"file": "",
Expand All @@ -38,7 +38,7 @@
"title": "adds a review and verifies success message",
"fullTitle": "Add review on product adds a review and verifies success message",
"timedOut": null,
"duration": 161576,
"duration": 26437,
"state": "passed",
"speed": "slow",
"pass": true,
Expand All @@ -47,20 +47,20 @@
"context": null,
"code": "cy.visit('http://automationexercise.com');\n// Click on 'Products' button\ncy.get('a[href=\"/products\"]').click();\n// Verify user is navigated to ALL PRODUCTS page\ncy.contains('All Products').should('be.visible');\n// Select a product (replace with logic to choose a product)\n// ... your logic to select a product ...\n// Click on 'View Product' button\ncy.get('a[href=\"/product_details/1\"]').click(); // Assuming the first product\n// Verify 'Write Your Review' is visible\ncy.contains('Write Your Review').should('be.visible');\n// Enter name, email and review\nconst reviewerName = 'Test User';\nconst reviewerEmail = '[email protected]';\nconst reviewText = 'This is a great product!';\ncy.get('#name').type(reviewerName);\ncy.get('#email').type(reviewerEmail);\ncy.get('#button-review').type(reviewText);\n// Verify success message 'Thank you for your review.'\ncy.get('#review-section div > span').should('contain', 'Thank you for your review.');",
"err": {},
"uuid": "770b6011-d65b-4fc3-bf2c-2da56ac3e269",
"parentUUID": "ac6cd77e-71ff-4cc8-9d78-29df9affe268",
"uuid": "652d6398-8bc6-46d9-935d-e97cc5e8b9de",
"parentUUID": "c96ca9b3-0c1c-4200-abe1-ebccebfcc0fc",
"isHook": false,
"skipped": false
}
],
"suites": [],
"passes": [
"770b6011-d65b-4fc3-bf2c-2da56ac3e269"
"652d6398-8bc6-46d9-935d-e97cc5e8b9de"
],
"failures": [],
"pending": [],
"skipped": [],
"duration": 161576,
"duration": 26437,
"root": false,
"rootEmpty": false,
"_timeout": 2000
Expand Down
20 changes: 10 additions & 10 deletions cypress/reports/.jsons/mochawesome_002.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"passes": 1,
"pending": 0,
"failures": 0,
"start": "2024-07-12T16:04:08.640Z",
"end": "2024-07-12T16:04:49.899Z",
"duration": 41259,
"start": "2024-07-14T04:17:17.274Z",
"end": "2024-07-14T04:17:39.755Z",
"duration": 22481,
"testsRegistered": 1,
"passPercent": 100,
"pendingPercent": 0,
Expand All @@ -18,7 +18,7 @@
},
"results": [
{
"uuid": "4e3d0034-1bd5-4abf-8325-b06b04bda0fc",
"uuid": "5f887141-10af-47c0-adf2-e72bec342675",
"title": "",
"fullFile": "cypress\\e2e\\add_to_cart_from_recommended_items.cy.js",
"file": "cypress\\e2e\\add_to_cart_from_recommended_items.cy.js",
Expand All @@ -27,7 +27,7 @@
"tests": [],
"suites": [
{
"uuid": "7c758fc2-6934-4f76-8a4e-828f759c165a",
"uuid": "128ada13-9e1e-4e54-b387-2250dd652c64",
"title": "Add to cart from Recommended items",
"fullFile": "",
"file": "",
Expand All @@ -38,7 +38,7 @@
"title": "adds a recommended product to cart and verifies",
"fullTitle": "Add to cart from Recommended items adds a recommended product to cart and verifies",
"timedOut": null,
"duration": 34390,
"duration": 13086,
"state": "passed",
"speed": "slow",
"pass": true,
Expand All @@ -47,20 +47,20 @@
"context": null,
"code": "cy.visit('http://automationexercise.com');\n// Scroll to bottom of page\ncy.scrollTo('bottom');\n// Verify 'RECOMMENDED ITEMS' are visible\ncy.contains('recommended items').should('be.visible');\n// Click on 'Add To Cart' on the first Recommended product (adjust selector if needed)\ncy.get('#recommended-item-carousel div > a').first().click({\n force: true\n}); // Assuming \"Add To Cart\" is next to product title\ncy.wait(2000);\n// Click on 'Continue Shopping' button\ncy.get('#cartModal > div > div > div.modal-footer > button').click({\n force: true\n});\ncy.wait(1000);\n// Click on 'View Cart' button\ncy.get('.nav a[href=\"/view_cart\"]').click();\n// Verify that product is displayed in cart page and display none\ncy.get('#cart_info_table').should('be.visible').and('not.have.css', 'display', 'none');",
"err": {},
"uuid": "f7730025-4739-4db4-9dae-186af03ad173",
"parentUUID": "7c758fc2-6934-4f76-8a4e-828f759c165a",
"uuid": "a0037e42-c215-4531-b3b4-aa088a45a952",
"parentUUID": "128ada13-9e1e-4e54-b387-2250dd652c64",
"isHook": false,
"skipped": false
}
],
"suites": [],
"passes": [
"f7730025-4739-4db4-9dae-186af03ad173"
"a0037e42-c215-4531-b3b4-aa088a45a952"
],
"failures": [],
"pending": [],
"skipped": [],
"duration": 34390,
"duration": 13086,
"root": false,
"rootEmpty": false,
"_timeout": 2000
Expand Down
20 changes: 10 additions & 10 deletions cypress/reports/.jsons/mochawesome_003.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"passes": 1,
"pending": 0,
"failures": 0,
"start": "2024-07-12T16:04:57.223Z",
"end": "2024-07-12T16:06:09.010Z",
"duration": 71787,
"start": "2024-07-14T04:17:49.041Z",
"end": "2024-07-14T04:18:23.354Z",
"duration": 34313,
"testsRegistered": 1,
"passPercent": 100,
"pendingPercent": 0,
Expand All @@ -18,7 +18,7 @@
},
"results": [
{
"uuid": "9a4dba1a-c616-401b-b03b-f4edc6117aba",
"uuid": "900a9a86-f8a2-454e-87bb-29f3615afbb0",
"title": "",
"fullFile": "cypress\\e2e\\contact_us.cy.js",
"file": "cypress\\e2e\\contact_us.cy.js",
Expand All @@ -27,7 +27,7 @@
"tests": [],
"suites": [
{
"uuid": "9cc097ea-d0cf-4f57-aaee-7ed5ec3699a9",
"uuid": "21d4e7e1-9d58-4a54-a8c3-310b7d0a5e9a",
"title": "Contact Us Form",
"fullFile": "",
"file": "",
Expand All @@ -38,7 +38,7 @@
"title": "Contact Us Form validation checking....",
"fullTitle": "Contact Us Form Contact Us Form validation checking....",
"timedOut": null,
"duration": 64633,
"duration": 24469,
"state": "passed",
"speed": "slow",
"pass": true,
Expand All @@ -47,20 +47,20 @@
"context": null,
"code": "// Step 1: Launch browser\n// Cypress automatically launches the browser\n// Step 2: Navigate to url 'http://automationexercise.com'\ncy.visit('http://automationexercise.com');\n// Step 3: Verify that home page is visible successfully\ncy.url().should('include', 'automationexercise');\n// Step 4: Click on 'Contact Us' button\ncy.contains('Contact us').click();\n// Step 5: Verify 'GET IN TOUCH' is visible\ncy.get('#contact-page > div.row > div.col-sm-8 > div > h2').should('contain', 'Get In Touch');\n// Step 6: Enter name, email, subject and message\ncy.get('[data-qa=\"name\"]').type('Test User');\ncy.get('[data-qa=\"email\"]').type('[email protected]');\ncy.get('[data-qa=\"subject\"]').type('Test Subject');\ncy.get('[data-qa=\"message\"]').type('Test Message');\n// Step 7: Upload file\nconst fileName = './reports/unittest.pdf';\ncy.get('input[type=file]').selectFile(fileName);\n// Step 8: Click 'Submit' button\ncy.get('[data-qa=\"submit-button\"]').click();\n// Step 9: Click OK button\ncy.on('window:confirm', () => true);\n// Step 10: Verify success message 'Success! Your details have been submitted successfully.' is visible\ncy.get('.status ').should('contain', 'Success! Your details have been submitted successfully.');\n// Step 11: Click 'Home' button and verify that landed to home page successfully\ncy.get('#form-section > a > span > i').click();\ncy.url().should('include', 'automationexercise');",
"err": {},
"uuid": "66080538-ac14-4380-8384-c39df826bcd0",
"parentUUID": "9cc097ea-d0cf-4f57-aaee-7ed5ec3699a9",
"uuid": "f3d7f4c9-90d1-46e7-94ca-f1ffae54d99a",
"parentUUID": "21d4e7e1-9d58-4a54-a8c3-310b7d0a5e9a",
"isHook": false,
"skipped": false
}
],
"suites": [],
"passes": [
"66080538-ac14-4380-8384-c39df826bcd0"
"f3d7f4c9-90d1-46e7-94ca-f1ffae54d99a"
],
"failures": [],
"pending": [],
"skipped": [],
"duration": 64633,
"duration": 24469,
"root": false,
"rootEmpty": false,
"_timeout": 2000
Expand Down
Loading

0 comments on commit ae49659

Please sign in to comment.