diff --git a/cypress/reports/.jsons/mochawesome.json b/cypress/reports/.jsons/mochawesome.json new file mode 100644 index 0000000..1586e4f --- /dev/null +++ b/cypress/reports/.jsons/mochawesome.json @@ -0,0 +1,111 @@ +{ + "stats": { + "suites": 1, + "tests": 1, + "passes": 1, + "pending": 0, + "failures": 0, + "start": "2024-07-09T12:50:14.759Z", + "end": "2024-07-09T12:51:17.180Z", + "duration": 62421, + "testsRegistered": 1, + "passPercent": 100, + "pendingPercent": 0, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false + }, + "results": [ + { + "uuid": "3e2da50a-27d6-4af1-852e-b200f3df4164", + "title": "", + "fullFile": "cypress\\e2e\\add_product_cart.cy.js", + "file": "cypress\\e2e\\add_product_cart.cy.js", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "f67578bd-b240-4ba8-9e46-1cc91bf826f9", + "title": "Test Case 12: Add Products in Cart", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Add Products in Cart", + "fullTitle": "Test Case 12: Add Products in Cart Add Products in Cart", + "timedOut": null, + "duration": 54846, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "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": "8f4889e7-1591-4cf4-8ceb-321299004aff", + "parentUUID": "f67578bd-b240-4ba8-9e46-1cc91bf826f9", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "8f4889e7-1591-4cf4-8ceb-321299004aff" + ], + "failures": [], + "pending": [], + "skipped": [], + "duration": 54846, + "root": false, + "rootEmpty": false, + "_timeout": 2000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 2000 + } + ], + "meta": { + "mocha": { + "version": "7.0.1" + }, + "mochawesome": { + "options": { + "quiet": false, + "reportFilename": "mochawesome", + "saveHtml": false, + "saveJson": true, + "consoleReporter": "spec", + "useInlineDiffs": false, + "code": true + }, + "version": "7.1.3" + }, + "marge": { + "options": { + "id": "default", + "charts": true, + "reportPageTitle": "custom-title", + "reportDir": "cypress\\reports\\.jsons", + "embeddedScreenshots": true, + "inlineAssets": true, + "saveAllAttempts": true, + "overwrite": false, + "html": false, + "json": true + }, + "version": "6.2.0" + } + } +} \ No newline at end of file diff --git a/cypress/reports/.jsons/mochawesome_001.json b/cypress/reports/.jsons/mochawesome_001.json new file mode 100644 index 0000000..e7a8fd5 --- /dev/null +++ b/cypress/reports/.jsons/mochawesome_001.json @@ -0,0 +1,111 @@ +{ + "stats": { + "suites": 1, + "tests": 1, + "passes": 1, + "pending": 0, + "failures": 0, + "start": "2024-07-09T12:51:22.669Z", + "end": "2024-07-09T12:52:03.287Z", + "duration": 40618, + "testsRegistered": 1, + "passPercent": 100, + "pendingPercent": 0, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false + }, + "results": [ + { + "uuid": "d8bcf7d2-28bc-4a1a-ad1d-6c0deaadfecd", + "title": "", + "fullFile": "cypress\\e2e\\add_review_on_product.cy.js", + "file": "cypress\\e2e\\add_review_on_product.cy.js", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "1091164f-ca3a-48ad-a87f-54963b398724", + "title": "Add review on product", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "adds a review and verifies success message", + "fullTitle": "Add review on product adds a review and verifies success message", + "timedOut": null, + "duration": 34303, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "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 = 'test.user@example.com';\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": "6706c22c-2092-4ef7-b5b0-21c246a9b8a9", + "parentUUID": "1091164f-ca3a-48ad-a87f-54963b398724", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "6706c22c-2092-4ef7-b5b0-21c246a9b8a9" + ], + "failures": [], + "pending": [], + "skipped": [], + "duration": 34303, + "root": false, + "rootEmpty": false, + "_timeout": 2000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 2000 + } + ], + "meta": { + "mocha": { + "version": "7.0.1" + }, + "mochawesome": { + "options": { + "quiet": false, + "reportFilename": "mochawesome", + "saveHtml": false, + "saveJson": true, + "consoleReporter": "spec", + "useInlineDiffs": false, + "code": true + }, + "version": "7.1.3" + }, + "marge": { + "options": { + "id": "default", + "charts": true, + "reportPageTitle": "custom-title", + "reportDir": "cypress\\reports\\.jsons", + "embeddedScreenshots": true, + "inlineAssets": true, + "saveAllAttempts": true, + "overwrite": false, + "html": false, + "json": true + }, + "version": "6.2.0" + } + } +} \ No newline at end of file diff --git a/cypress/reports/.jsons/mochawesome_002.json b/cypress/reports/.jsons/mochawesome_002.json new file mode 100644 index 0000000..e52166c --- /dev/null +++ b/cypress/reports/.jsons/mochawesome_002.json @@ -0,0 +1,111 @@ +{ + "stats": { + "suites": 1, + "tests": 1, + "passes": 1, + "pending": 0, + "failures": 0, + "start": "2024-07-09T12:52:08.534Z", + "end": "2024-07-09T12:52:33.142Z", + "duration": 24608, + "testsRegistered": 1, + "passPercent": 100, + "pendingPercent": 0, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false + }, + "results": [ + { + "uuid": "c067aab3-b913-47f5-b994-99e061ab866e", + "title": "", + "fullFile": "cypress\\e2e\\add_to_cart_from_recommended_items.cy.js", + "file": "cypress\\e2e\\add_to_cart_from_recommended_items.cy.js", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "c64a014d-7b8e-4fa1-a4dd-655ccb204622", + "title": "Add to cart from Recommended items", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "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": 18231, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "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": "33c09cab-6a9a-4a30-9590-b6e573762b59", + "parentUUID": "c64a014d-7b8e-4fa1-a4dd-655ccb204622", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "33c09cab-6a9a-4a30-9590-b6e573762b59" + ], + "failures": [], + "pending": [], + "skipped": [], + "duration": 18231, + "root": false, + "rootEmpty": false, + "_timeout": 2000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 2000 + } + ], + "meta": { + "mocha": { + "version": "7.0.1" + }, + "mochawesome": { + "options": { + "quiet": false, + "reportFilename": "mochawesome", + "saveHtml": false, + "saveJson": true, + "consoleReporter": "spec", + "useInlineDiffs": false, + "code": true + }, + "version": "7.1.3" + }, + "marge": { + "options": { + "id": "default", + "charts": true, + "reportPageTitle": "custom-title", + "reportDir": "cypress\\reports\\.jsons", + "embeddedScreenshots": true, + "inlineAssets": true, + "saveAllAttempts": true, + "overwrite": false, + "html": false, + "json": true + }, + "version": "6.2.0" + } + } +} \ No newline at end of file diff --git a/cypress/reports/.jsons/mochawesome_003.json b/cypress/reports/.jsons/mochawesome_003.json new file mode 100644 index 0000000..e006dac --- /dev/null +++ b/cypress/reports/.jsons/mochawesome_003.json @@ -0,0 +1,111 @@ +{ + "stats": { + "suites": 1, + "tests": 1, + "passes": 1, + "pending": 0, + "failures": 0, + "start": "2024-07-09T12:52:38.249Z", + "end": "2024-07-09T12:53:03.284Z", + "duration": 25035, + "testsRegistered": 1, + "passPercent": 100, + "pendingPercent": 0, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false + }, + "results": [ + { + "uuid": "960a1871-e97c-4feb-88c2-c2315e09b85e", + "title": "", + "fullFile": "cypress\\e2e\\contact_us.cy.js", + "file": "cypress\\e2e\\contact_us.cy.js", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "853674ac-ea29-4b93-8763-66acc99334ed", + "title": "Contact Us Form", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "Contact Us Form validation checking....", + "fullTitle": "Contact Us Form Contact Us Form validation checking....", + "timedOut": null, + "duration": 18385, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "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('testuser@example.com');\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": "747ded52-f6e6-4061-8fa3-3f4b97da3c40", + "parentUUID": "853674ac-ea29-4b93-8763-66acc99334ed", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "747ded52-f6e6-4061-8fa3-3f4b97da3c40" + ], + "failures": [], + "pending": [], + "skipped": [], + "duration": 18385, + "root": false, + "rootEmpty": false, + "_timeout": 2000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 2000 + } + ], + "meta": { + "mocha": { + "version": "7.0.1" + }, + "mochawesome": { + "options": { + "quiet": false, + "reportFilename": "mochawesome", + "saveHtml": false, + "saveJson": true, + "consoleReporter": "spec", + "useInlineDiffs": false, + "code": true + }, + "version": "7.1.3" + }, + "marge": { + "options": { + "id": "default", + "charts": true, + "reportPageTitle": "custom-title", + "reportDir": "cypress\\reports\\.jsons", + "embeddedScreenshots": true, + "inlineAssets": true, + "saveAllAttempts": true, + "overwrite": false, + "html": false, + "json": true + }, + "version": "6.2.0" + } + } +} \ No newline at end of file diff --git a/cypress/reports/.jsons/mochawesome_004.json b/cypress/reports/.jsons/mochawesome_004.json new file mode 100644 index 0000000..4d71c37 --- /dev/null +++ b/cypress/reports/.jsons/mochawesome_004.json @@ -0,0 +1,111 @@ +{ + "stats": { + "suites": 1, + "tests": 1, + "passes": 1, + "pending": 0, + "failures": 0, + "start": "2024-07-09T12:53:11.769Z", + "end": "2024-07-09T12:54:25.083Z", + "duration": 73314, + "testsRegistered": 1, + "passPercent": 100, + "pendingPercent": 0, + "other": 0, + "hasOther": false, + "skipped": 0, + "hasSkipped": false + }, + "results": [ + { + "uuid": "def8a987-2176-430e-a3d0-58d15d50b5b2", + "title": "", + "fullFile": "cypress\\e2e\\download_Invoice_after_purchase_order.cy.js", + "file": "cypress\\e2e\\download_Invoice_after_purchase_order.cy.js", + "beforeHooks": [], + "afterHooks": [], + "tests": [], + "suites": [ + { + "uuid": "d28f9ccb-fe05-4264-8f51-0e5ce9fa551a", + "title": "Download Invoice after purchase order", + "fullFile": "", + "file": "", + "beforeHooks": [], + "afterHooks": [], + "tests": [ + { + "title": "should allow downloading invoice after successful purchase", + "fullTitle": "Download Invoice after purchase order should allow downloading invoice after successful purchase", + "timedOut": null, + "duration": 65832, + "state": "passed", + "speed": "slow", + "pass": true, + "fail": false, + "pending": false, + "context": null, + "code": "cy.visit('http://automationexercise.com');\n// Verify home page is visible\ncy.get('.logo a>img').should('be.visible');\n//click signup/login button\ncy.contains('Signup / Login').click();\n// Fill all details in Signup and create account\ncy.contains('New User Signup!').should('be.visible');\ncy.get('[data-qa=\"signup-name\"]').type('Amir Hossain');\ncy.get('[data-qa=\"signup-email\"]').type('amir.swe@gmail.com');\ncy.get('[data-qa=\"signup-button\"]').click();\n// Fill in account details\n// Replace '#input' with the actual selectors for each input field\ncy.get('#id_gender1').type('Mr.');\ncy.get('[data-qa=\"password\"]').type('abubakkar90');\ncy.get('[data-qa=\"days\"]').select('1');\ncy.get('[data-qa=\"months\"]').select('January');\ncy.get('[data-qa=\"years\"]').select('1998');\ncy.get('#newsletter').check();\ncy.get('#optin').check();\ncy.get('[data-qa=\"first_name\"]').type('Amir');\ncy.get('[data-qa=\"last_name\"]').type('Hossain');\ncy.get('[data-qa=\"company\"]').type('Test Company');\ncy.get('[data-qa=\"address\"]').type('123 Test St');\ncy.get('[data-qa=\"address2\"]').type('Apt 4B');\ncy.get('#country').select('Canada');\ncy.get('[data-qa=\"state\"]').type('NY');\ncy.get('[data-qa=\"city\"]').type('New York');\ncy.get('[data-qa=\"zipcode\"]').type('10001');\ncy.get('[data-qa=\"mobile_number\"]').type('1234567890');\ncy.get('[data-qa=\"create-account\"]').click();\ncy.get('[data-qa=\"account-created\"]').contains('Account Created!');\ncy.get('[data-qa=\"continue-button\"]').click();\n// Verify ' Logged in as username' at top\ncy.contains('Logged in as Amir Hossain').should('be.visible');\n// add product\ncy.get('.product-image-wrapper .choose > ul >li >a').first().click();\n// Verify product detail is opened\ncy.get('.product-information').should('be.visible');\n// Increase quantity to 4\ncy.get('#quantity').clear().type('4');\n// Click 'Add to cart' button\ncy.get('.cart').click();\n// confirm the product\ncy.get('#cartModal > div > div > div.modal-footer > button').click();\n// Click 'View Cart' button\ncy.get('li [href=\"/view_cart\"]').click();\n// Verify cart page is displayed\ncy.get('.cart_info').should('be.visible');\n// Click 'Proceed To Checkout' button again\ncy.contains('Proceed To Checkout').click();\n// Enter description in comment text area and click 'Place Order'\ncy.get('#ordermsg').type('Test order with registration');\ncy.contains('Place Order').click();\n// Click 'Pay and Confirm Order' button\ncy.get('[data-qa=\"name-on-card\"]').type('Amir Hossain');\ncy.get('[data-qa=\"card-number\"]').type('5655-1814-0058-1255');\ncy.get('[data-qa=\"cvc\"]').type('588');\ncy.get('[data-qa=\"expiry-month\"]').type('08/33');\ncy.get('[data-qa=\"expiry-year\"]').type('2033');\ncy.get('[data-qa = \"pay-button\"]').click();\n// Verify success message 'Your order has been placed successfully!'\ncy.contains('Congratulations! Your order has been confirmed!').should('be.visible');\n//Download Invoice\ncy.contains('Download Invoice').click();\n//Click on Continue Button\ncy.contains('Continue').click();\n// Click 'Delete Account' button\ncy.get('#header > div > div > div > div.col-sm-8 > div > ul > li:nth-child(5) > a').click();\n// Verify 'ACCOUNT DELETED!' and click 'Continue' button\ncy.get('[data-qa=\"account-deleted\"]').contains('Account Deleted!');\ncy.get('[data-qa=\"continue-button\"]').click();", + "err": {}, + "uuid": "0328d986-3fe6-417c-96a3-d1f745d62eeb", + "parentUUID": "d28f9ccb-fe05-4264-8f51-0e5ce9fa551a", + "isHook": false, + "skipped": false + } + ], + "suites": [], + "passes": [ + "0328d986-3fe6-417c-96a3-d1f745d62eeb" + ], + "failures": [], + "pending": [], + "skipped": [], + "duration": 65832, + "root": false, + "rootEmpty": false, + "_timeout": 2000 + } + ], + "passes": [], + "failures": [], + "pending": [], + "skipped": [], + "duration": 0, + "root": true, + "rootEmpty": true, + "_timeout": 2000 + } + ], + "meta": { + "mocha": { + "version": "7.0.1" + }, + "mochawesome": { + "options": { + "quiet": false, + "reportFilename": "mochawesome", + "saveHtml": false, + "saveJson": true, + "consoleReporter": "spec", + "useInlineDiffs": false, + "code": true + }, + "version": "7.1.3" + }, + "marge": { + "options": { + "id": "default", + "charts": true, + "reportPageTitle": "custom-title", + "reportDir": "cypress\\reports\\.jsons", + "embeddedScreenshots": true, + "inlineAssets": true, + "saveAllAttempts": true, + "overwrite": false, + "html": false, + "json": true + }, + "version": "6.2.0" + } + } +} \ No newline at end of file diff --git a/cypress/reports/index.html b/cypress/reports/index.html deleted file mode 100644 index 5d78349..0000000 --- a/cypress/reports/index.html +++ /dev/null @@ -1,17 +0,0 @@ - -