-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
98 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { LoginPage } from '@support/pages/login.page' | ||
import { LoginInfo } from '..' | ||
|
||
const user: LoginInfo = Cypress.env('users').standard | ||
|
||
interface ItemInCart { | ||
id: string | ||
n: number | ||
} | ||
|
||
// Tip: read the Cypress Network testing guide before implementing this test | ||
// https://on.cypress.io/network-requests | ||
|
||
it('loads the saved cart contents', () => { | ||
LoginPage.login(user.username, user.password) | ||
// stub network call to "GET /user-cart" API endpoint | ||
// https://on.cypress.io/intercept | ||
// return fixture "cypress/fixtures/user-cart.json" | ||
// | ||
// give the network intercept alias "cart" | ||
// https://on.cypress.io/as | ||
// | ||
// visit the cart page | ||
cy.visit('/cart.html') | ||
// confirm we are at the cart page and are not redirected anywhere else | ||
cy.location('pathname').should('equal', '/cart.html') | ||
// confirm the page requested the user cart | ||
// https://on.cypress.io/wait | ||
// | ||
// confirm that every item from the fixture cart "user-cart.json" is shown | ||
// and the number of items is correct | ||
// https://on.cypress.io/fixture | ||
// | ||
// there should be same number of items on the page | ||
// as loaded from the fixture | ||
// | ||
// iterate over items in the fixture | ||
// each item has properties "id" and "n" | ||
// just like interface ItemInCart shows | ||
// | ||
// find the item cart item on the page with data item id attribute | ||
// equal to the item's "id" property | ||
// | ||
// find the quantity input element | ||
// | ||
// it should have value equal to the item's "n" property | ||
// | ||
}) |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"id": 4, | ||
"n": 2 | ||
}, | ||
{ | ||
"id": 5, | ||
"n": 3 | ||
} | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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