Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new ui tests for plan selection #1864

Merged
merged 39 commits into from
Jan 21, 2022
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b4635b4
add test fixture for card data
Jan 7, 2022
e4464e8
add new billing flow identifiers for page objects
Jan 7, 2022
84febc8
add card modal test object and subscription plan spec file (wip)
Jan 7, 2022
acdcd00
add reminder
Jan 7, 2022
900ced2
allow typing into stripe iframe
Tbaut Jan 7, 2022
7f905eb
Merge branch 'dev' into mnt/add-card-ui-tests-1842
Jan 7, 2022
8241831
Add new checks for update and removing a card
Jan 8, 2022
d062e14
improve reliability of another test after spotting issue in ci
Jan 10, 2022
8559301
ensure we are not trying to click too early, addresses ci failure
Jan 10, 2022
f3b2799
Merge branch 'dev' into mnt/add-card-ui-tests-1842
asnaith Jan 11, 2022
6bb9fea
add card deletion option (#1850)
Tbaut Jan 12, 2022
abd743e
Merge branch 'dev' into mnt/add-card-ui-tests-1842
Tbaut Jan 13, 2022
9cddd40
add timeout to iframe
asnaith Jan 14, 2022
096f830
add new identifiers for subscription plan modal elements
Jan 14, 2022
95d11f0
add new test for selecting different subscription plans (wip)
Jan 14, 2022
5b4cbcd
Merge branch 'dev' into mnt/add-card-ui-tests-1842
Jan 14, 2022
552781c
Merge branch 'dev' into mnt/add-card-ui-tests-1842
Tbaut Jan 14, 2022
5996bf0
add intercepts to spy on requests, remove waits
Jan 15, 2022
3bc432c
Merge branch 'mnt/add-card-ui-tests-1842' of github.com:ChainSafe/fil…
Jan 15, 2022
ba6f74e
add strip key to test runner
Tbaut Jan 17, 2022
37519ba
Apply locator syntax suggestions from code review
asnaith Jan 17, 2022
4eec981
Merge branch 'dev' into mnt/add-card-ui-tests-1842
Jan 17, 2022
6222175
lingui extract
actions-user Jan 17, 2022
ff6969c
Merge branch 'mnt/add-card-ui-tests-1842' into mnt/change-plan-ui-tes…
Jan 17, 2022
769a9f5
rename modal
Jan 18, 2022
6a42fbd
add page object for plan details modal
Jan 18, 2022
ee6343c
add new plan selection test
Jan 18, 2022
3daa6d5
Merge branch 'dev' into mnt/add-card-ui-tests-1842
FSM1 Jan 18, 2022
80c4ee9
increase time out for plan container
Jan 18, 2022
bd4a423
Merge branch 'mnt/add-card-ui-tests-1842' into mnt/change-plan-ui-tes…
Jan 18, 2022
35d4476
tidy up
Jan 18, 2022
9dbdb4f
further tidy up
Jan 18, 2022
256e0f0
remove duplicate identifier
Jan 18, 2022
d9ae9cb
Merge branch 'dev' into mnt/change-plan-ui-tests-1857
Jan 19, 2022
bb435a9
add testId prop to ToggleSwitch component
Tbaut Jan 20, 2022
c4263e9
Update packages/files-ui/src/Components/Modules/Settings/Subscription…
Tbaut Jan 20, 2022
b6e0218
add ui test for checking invalid card details (#1868)
asnaith Jan 20, 2022
5e5b23f
Merge branch 'dev' into mnt/change-plan-ui-tests-1857
FSM1 Jan 21, 2022
234ffa2
lingui extract
actions-user Jan 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add new test for selecting different subscription plans (wip)
Andrew Snaith committed Jan 14, 2022
commit 95d11f0a9f0f1e15ffa211dbe0e937b464b6e538
53 changes: 53 additions & 0 deletions packages/files-ui/cypress/tests/subscription-plan-spec.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import { mastercardNumber, mastercardExpiry, mastercardCvc } from "../fixtures/c
import { cardAddedToast } from "../support/page-objects/toasts/cardAddedToast"
import { cardUpdatedToast } from "../support/page-objects/toasts/cardUpdatedToast"
import { removeCardModal } from "../support/page-objects/modals/removeCardModal"
import { selectPlanModal } from "../support/page-objects/modals/selectPlanModal"

describe("Subscription Plan", () => {

@@ -71,5 +72,57 @@ describe("Subscription Plan", () => {
settingsPage.noCardLabel().should("be.visible")
settingsPage.addCardButton().should("be.visible")
})

it("can select different subscription plans and view plan summaries", () => {
cy.web3Login()

// navigate to settings
navigationMenu.settingsNavButton().click()
settingsPage.subscriptionTabButton().click()
settingsPage.changePlanButton().click()

selectPlanModal.body().should("be.visible")
selectPlanModal.planBoxContainer().should("have.length.greaterThan", 0)

// create cypress aliases for the plans
selectPlanModal.planBoxContainer().contains("Free plan")
.should("be.visible")
.as("freePlanBox")
selectPlanModal.planBoxContainer().contains("Standard plan")
.should("be.visible")
.as("standardPlanBox")
selectPlanModal.planBoxContainer().contains("Premium plan")
.should("be.visible")
.as("premiumPlanBox")

// ensure all plan boxes contain expected elements and element state
cy.get("@freePlanBox").parent().within(() => {
selectPlanModal.planTitleLabel().should("be.visible")
selectPlanModal.FreePriceLabel().should("be.visible")
selectPlanModal.storageDescriptionLabel().should("be.visible")
selectPlanModal.selectPlanButton()
.should("be.visible")
// button should be disabled when already on free plan
.should("be.disabled")
})

cy.get("@standardPlanBox").parent().within(() => {
selectPlanModal.planTitleLabel().should("be.visible")
selectPlanModal.monthlyPriceLabel().should("be.visible")
selectPlanModal.storageDescriptionLabel().should("be.visible")
selectPlanModal.selectPlanButton()
.should("be.visible")
.should("be.enabled")
})

cy.get("@premiumPlanBox").parent().within(() => {
selectPlanModal.planTitleLabel().should("be.visible")
selectPlanModal.monthlyPriceLabel().should("be.visible")
selectPlanModal.storageDescriptionLabel().should("be.visible")
selectPlanModal.selectPlanButton()
.should("be.visible")
.should("be.enabled")
})
})
})
})