Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. /// <reference types="cypress" />
  2.  
  3. describe("Product Comparison", () => {
  4. beforeEach(() => {
  5. cy.visit("/");
  6. });
  7.  
  8. it("selects two products to compare them", () => {
  9. // Start the test
  10. cy.eyesOpen({
  11. appName: "ProductCompare",
  12. testName: "Select 2 products to compare",
  13. browser: { width: 800, height: 600 }
  14. });
  15.  
  16. // Click the Cherry Product
  17. cy.get("[data-cy=one-product]")
  18. .find("[data-cy=view-details]")
  19. .eq(0)
  20. .click();
  21.  
  22. // Take a snapshot
  23. cy.eyesCheckWindow("first product selected");
  24.  
  25. // Click the Orange Product
  26. cy.get("[data-cy=one-product]")
  27. .find("[data-cy=view-details]")
  28. .eq(1)
  29. .click();
  30.  
  31. // Take a snapshot
  32. cy.eyesCheckWindow("second product selected");
  33.  
  34. // Verify Cherry was added to the comparison list
  35. cy.get("[data-cy=product-compare]").contains("Cherry");
  36.  
  37. // Verify Orange was added to the comparison list
  38. cy.get("[data-cy=product-compare]").contains("Orange");
  39.  
  40. // End Test
  41. cy.eyesClose();
  42. });
  43. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement