Created
May 22, 2022 21:28
-
-
Save TerkaVrana/9c703c586666002a2ffa65963a8827c2 to your computer and use it in GitHub Desktop.
Deepnote webpage testing - cypress (Vránková)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseUrl = "https://deepnote.com" | |
context("Deepnote Pricingpage", () =>{ | |
beforeEach(() =>{ | |
cy.viewport('macbook-13') | |
}) | |
// 1. Check that you can navigate to the pricing page from the homepage: cy.viewport('macbook-13') | |
it("can be navigated to from homepage - macbook-13", () =>{ | |
cy.visit(baseUrl) | |
cy.contains('header a', 'Pricing').click(); | |
cy.get('h1').should('contain.text', 'Pricing') | |
cy.url().should('eq', baseUrl+'/pricing') | |
}) | |
// 1. Check that you can navigate to the pricing page from the homepage: cy.viewport('samsung-s10') | |
it("can be navigated to from homepage - samsung-s10", () =>{ | |
cy.viewport('samsung-s10') | |
cy.visit(baseUrl) | |
cy.get('header svg').click(); | |
cy.contains('.css-353bjn-links a', 'Pricing').click(); | |
// TODO: Add data-cy to components :) class="css-353bjn-links" | |
cy.get('h1').should('contain.text', 'Pricing') | |
cy.url().should('eq', baseUrl+'/pricing') | |
}) | |
// 2. Check that there are three plans on the pricing page (Started for free, Pro for $12, and Enterprise for $99) | |
it("three plans on the pricing page", () =>{ | |
cy.visit(baseUrl+'/pricing') | |
cy.contains('th', 'Starter').should('contain.text', '$0') | |
// contant is "Starter" for "$0" instead of "Started for free" | |
cy.contains('th', 'Pro').should('contain.text', '$12') | |
cy.contains('th', 'Enterprise').should('contain.text', '$99') | |
}) | |
// 3. Check that the link "Free Pro plans for students and teachers" on the pricing page leads to the education page | |
it("Free Pro plans for students and teachers on the pricing page", () =>{ | |
cy.visit(baseUrl+'/pricing') | |
cy.contains('a', 'Free Pro plans for students and teachers').click({scrollBehavior:'center'}) | |
cy.get('h1').should('contain.text', 'Deepnote is free for students, teachers and researchers') | |
cy.url().should('eq', baseUrl+'/education') | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment