Skip to content

Commit

Permalink
TC-47 Test cypress e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Tkachev committed Jan 15, 2025
1 parent bd883e3 commit fd0c5a2
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions tests/e2e/cypress/integration/home_page_test.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,29 @@ describe('Login Test', () => {

cy.get('button.btn.btn-primary').contains('Anmelden').click();
cy.wait(5000);
// Verify login success (adjust based on actual post-login behavior)
// Example: Check if the user is redirected to the account page or a welcome message is displayed
cy.url().should('include', '/mein-konto');
cy.contains('Willkommen').should('exist');
// Step 2: Scroll to the product container
cy.get('#newItems').scrollIntoView();

// Step 3: Click on the first product link
cy.get('#newItems .card.product-card a.stretched-link').first().click();

// Step 4: Wait for the product page to load
cy.url().should('include', '/Merchandise/Sonnenbrillen/Ocean-Eyes.html');

// Step 5: Click the "In den Warenkorb" button
cy.get('button#toBasket').click();

// Step 6: Open the cart modal
cy.get('button.btn-minibasket').click();

// Step 7: Verify the cart contains 1 item
cy.get('#basketModal').should('be.visible');
cy.get('#basketModal').contains('1 Artikel im Warenkorb');

// Step 8: Click the "Zur Kasse" button
cy.get('#basketModal a.btn.btn-highlight.btn-lg').contains('Zur Kasse').click();

// Step 9: Verify navigation to the payment page
cy.url().should('include', '/index.php?lang=0&cl=payment');
});
});

0 comments on commit fd0c5a2

Please sign in to comment.