-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into dev/merge-branches
- Loading branch information
Showing
11 changed files
with
1,531 additions
and
0 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,3 @@ | ||
node_modules | ||
.DS_Store | ||
.idea |
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,8 @@ | ||
# Running Venia Integration Tests | ||
|
||
## Setup | ||
|
||
1. Clone the repo and change directory to pwa-studio/venia-integration-tests | ||
2. Run `yarn install` | ||
3. Run `yarn test` | ||
4. Now select test to Run from Cypress UI. |
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,12 @@ | ||
{ | ||
"baseUrl": "https://develop.pwa-venia.com/", | ||
"defaultCommandTimeout": 10000, | ||
"env": {}, | ||
"fixturesFolder": "src/fixtures", | ||
"integrationFolder": "src/tests", | ||
"pageLoadTimeout": 30000, | ||
"requestTimeout": 30000, | ||
"testFiles": "**/*.spec.js", | ||
"viewportHeight": 900, | ||
"viewportWidth": 1440 | ||
} |
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,17 @@ | ||
{ | ||
"name": "pwa-integration-tests", | ||
"version": "0.0.1", | ||
"description": "Venia Integration Automation Tests", | ||
"author": "Magento Commerce", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"cypress": "~6.8.0" | ||
}, | ||
"scripts": { | ||
"test": "cypress open --browser chrome --config-file cypress.config.json", | ||
"test:firefox": "cypress open --browser firefox --config-file cypress.config.json", | ||
"test:headless": "cypress open --browser chrome --headless --config-file cypress.config.json", | ||
"test:run": "cypress run --browser chrome --config-file cypress.config.json", | ||
"test:debug": "node --inspect-brk ./node_modules/cypress/bin/cypress open --browser chrome --config-file cypress.config.json" | ||
} | ||
} |
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,32 @@ | ||
import { | ||
usernameField, | ||
passwordField, | ||
loginTriggerField | ||
} from '../../fields/login'; | ||
|
||
/** | ||
* Utility function to login to Venia using the | ||
* username and password provided. | ||
* | ||
* @param {String} username username to login | ||
* @param {String} password password to login | ||
*/ | ||
export const login = (username, password) => { | ||
// Enter username into the username field | ||
cy.get(usernameField).type(username); | ||
|
||
// Enter password into the password field | ||
cy.get(passwordField).type(password); | ||
}; | ||
|
||
/** | ||
* Utility function to open the login dialog | ||
*/ | ||
export const openLoginDialog = () => { | ||
cy.visit('/'); | ||
|
||
cy.wait(500); | ||
|
||
// open the signin dialog | ||
cy.get(loginTriggerField).click(); | ||
}; |
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,3 @@ | ||
export const accountMenuItemsField = 'div[data-id="account-menu-items"]'; | ||
|
||
export const orderHistoryLink = 'a[data-id="account-menu-order-history"]'; |
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,5 @@ | ||
export const usernameField = 'input[data-id^="username"]'; | ||
|
||
export const passwordField = 'input[data-id^="password"]'; | ||
|
||
export const loginTriggerField = 'button[data-id^="loginTrigger"]'; |
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,3 @@ | ||
export const username = 'gooston@gmail.com'; | ||
|
||
export const password = '**********'; |
16 changes: 16 additions & 0 deletions
16
venia-integration-tests/src/tests/accountMenu/accountMenu.spec.js
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,16 @@ | ||
import { username, password } from '../../fixtures/login'; | ||
|
||
import { login, openLoginDialog } from '../../actions/login'; | ||
|
||
import { orderHistoryLink } from '../../fields/accountMenu'; | ||
|
||
describe('testing account menu items', () => { | ||
it('should render order history link', () => { | ||
openLoginDialog(); | ||
|
||
login(username, password); | ||
|
||
// asset that order history link is visible | ||
cy.get(orderHistoryLink).should('be.visible'); | ||
}); | ||
}); |
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,16 @@ | ||
import { username, password } from '../../fixtures/login'; | ||
|
||
import { login, openLoginDialog } from '../../actions/login'; | ||
|
||
import { accountMenuItemsField } from '../../fields/accountMenu'; | ||
|
||
describe('testing login trigger', () => { | ||
it('should login', () => { | ||
openLoginDialog(); | ||
|
||
login(username, password); | ||
|
||
// asset that login was successful | ||
cy.get(accountMenuItemsField).should('be.visible'); | ||
}); | ||
}); |
Oops, something went wrong.