-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3047 from Codeinwp/cypress/storybook-tests
test: adds tests for Storybook components
- Loading branch information
Showing
32 changed files
with
1,664 additions
and
19 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 |
---|---|---|
|
@@ -8,12 +8,15 @@ on: | |
|
||
jobs: | ||
e2e-storybook: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# run 3 copies of the current job in parallel | ||
containers: [1, 2, 3] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/[email protected] | ||
with: | ||
persist-credentials: false | ||
uses: actions/checkout@v2 | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
@@ -27,12 +30,25 @@ jobs: | |
- name: Build Cypress | ||
working-directory: ./e2e-tests | ||
run: yarn install --frozen-lockfile | ||
- name: Install and Build 🔧 | ||
- name: Start Storybook | ||
run: | | ||
yarn install --frozen-lockfile | ||
yarn run build | ||
yarn storybook & | ||
- name: E2E Tests 🚀 | ||
working-directory: ./e2e-tests | ||
run: | | ||
yarn run cypress:storybook:run --record --key=${{ secrets.CYPRESS_RECORD_KEY }} | ||
- name: Run Storybook Cypress tests 🚀 - ${{ matrix.container }} | ||
env: | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | ||
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true | ||
uses: cypress-io/github-action@v2 | ||
with: | ||
working-directory: ./e2e-tests | ||
env: host=localhost,port=6006 | ||
browser: chrome | ||
headless: true | ||
parallel: true | ||
group: e2e-storybook | ||
config-file: cypress.storybook.json | ||
record: true | ||
spec: cypress/integration/storybook/**/*, |
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
{ | ||
"projectId": "d8fiqf", | ||
"baseUrl": "http://localhost:6006", | ||
"retries": 1, | ||
"videoUploadOnPasses": false, | ||
"numTestsKeptInMemory": 0, | ||
"integrationFolder": "cypress/integration/storybook" | ||
"projectId": "d8fiqf", | ||
"baseUrl": "http://localhost:6006", | ||
"retries": 1, | ||
"videoUploadOnPasses": false, | ||
"numTestsKeptInMemory": 0, | ||
"watchForFileChanges": false, | ||
"integrationFolder": "cypress/integration/storybook", | ||
"experimentalStudio": true | ||
} |
234 changes: 234 additions & 0 deletions
234
e2e-tests/cypress/fixtures/storybook/controls/dynamic-fields-inserter.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,234 @@ | ||
{ | ||
"allOptions": [ | ||
{ | ||
"name": "Current Single Title", | ||
"value": "{current_single_title}" | ||
}, | ||
{ | ||
"name": "Current Single Excerpt", | ||
"value": "{current_single_excerpt}" | ||
}, | ||
{ | ||
"name": "Current Single URL", | ||
"value": "{current_single_url}" | ||
}, | ||
{ | ||
"name": "Current Post Meta", | ||
"value": "{current_post_meta}" | ||
}, | ||
{ | ||
"name": "Author meta", | ||
"value": "{meta_author}" | ||
}, | ||
{ | ||
"name": "Date meta", | ||
"value": "{meta_date}" | ||
}, | ||
{ | ||
"name": "Category meta", | ||
"value": "{meta_category}" | ||
}, | ||
{ | ||
"name": "Comments meta", | ||
"value": "{meta_comments}" | ||
}, | ||
{ | ||
"name": "Author meta", | ||
"value": "{meta_author}" | ||
}, | ||
{ | ||
"name": "Time to read meta", | ||
"value": "{meta_time_to_read}" | ||
}, | ||
{ | ||
"name": "Archive Description", | ||
"value": "{archive_description}" | ||
}, | ||
|
||
{ | ||
"name": "Archive Title", | ||
"value": "{archive_title}" | ||
}, | ||
{ | ||
"name": "Archive URL", | ||
"value": "{archive_url}" | ||
}, | ||
{ | ||
"name": "Author Bio", | ||
"value": "{author_bio}" | ||
}, | ||
{ | ||
"name": "Author Name", | ||
"value": "{author_name}" | ||
}, | ||
{ | ||
"name": "Author URL", | ||
"value": "{author_url}" | ||
}, | ||
{ | ||
"name": "Site Title", | ||
"value": "{site_title}" | ||
}, | ||
{ | ||
"name": "Site Tagline", | ||
"value": "{site_tagline}" | ||
}, | ||
{ | ||
"name": "Home URL", | ||
"value": "{home_url}" | ||
}, | ||
{ | ||
"name": "Current Year", | ||
"value": "{current_year}" | ||
}, | ||
{ | ||
"name": "Total + Currency Symbol", | ||
"value": "{cart_total_currency_symbol}" | ||
}, | ||
{ | ||
"name": "Total", | ||
"value": "{cart_total}" | ||
}, | ||
{ | ||
"name": "Currency Name", | ||
"value": "{currency_name}" | ||
}, | ||
{ | ||
"name": "Currency Symbol", | ||
"value": "{currency_symbol}" | ||
}, | ||
{ | ||
"name": "Product Price", | ||
"value": "{product_price}" | ||
}, | ||
{ | ||
"name": "Product Title", | ||
"value": "{product_title}" | ||
}, | ||
{ | ||
"name": "Cart URL", | ||
"value": "{cart_link}" | ||
}, | ||
{ | ||
"name": "Checkout URL", | ||
"value": "{checkout_link}" | ||
} | ||
], | ||
"onlyUrl": [ | ||
{ | ||
"name": "Current Single URL", | ||
"value": "{current_single_url}" | ||
}, | ||
{ | ||
"name": "Archive URL", | ||
"value": "{archive_url}" | ||
}, | ||
{ | ||
"name": "Author URL", | ||
"value": "{author_url}" | ||
}, | ||
{ | ||
"name": "Home URL", | ||
"value": "{home_url}" | ||
}, | ||
{ | ||
"name": "Cart URL", | ||
"value": "{cart_link}" | ||
}, | ||
{ | ||
"name": "Checkout URL", | ||
"value": "{checkout_link}" | ||
} | ||
], | ||
"noUrl": [ | ||
{ | ||
"name": "Current Single Title", | ||
"value": "{current_single_title}" | ||
}, | ||
{ | ||
"name": "Current Single Excerpt", | ||
"value": "{current_single_excerpt}" | ||
}, | ||
{ | ||
"name": "Current Post Meta", | ||
"value": "{current_post_meta}" | ||
}, | ||
{ | ||
"name": "Author meta", | ||
"value": "{meta_author}" | ||
}, | ||
{ | ||
"name": "Date meta", | ||
"value": "{meta_date}" | ||
}, | ||
{ | ||
"name": "Category meta", | ||
"value": "{meta_category}" | ||
}, | ||
{ | ||
"name": "Comments meta", | ||
"value": "{meta_comments}" | ||
}, | ||
{ | ||
"name": "Author meta", | ||
"value": "{meta_author}" | ||
}, | ||
{ | ||
"name": "Time to read meta", | ||
"value": "{meta_time_to_read}" | ||
}, | ||
{ | ||
"name": "Archive Description", | ||
"value": "{archive_description}" | ||
}, | ||
|
||
{ | ||
"name": "Archive Title", | ||
"value": "{archive_title}" | ||
}, | ||
{ | ||
"name": "Author Bio", | ||
"value": "{author_bio}" | ||
}, | ||
{ | ||
"name": "Author Name", | ||
"value": "{author_name}" | ||
}, | ||
{ | ||
"name": "Site Title", | ||
"value": "{site_title}" | ||
}, | ||
{ | ||
"name": "Site Tagline", | ||
"value": "{site_tagline}" | ||
}, | ||
{ | ||
"name": "Current Year", | ||
"value": "{current_year}" | ||
}, | ||
{ | ||
"name": "Total + Currency Symbol", | ||
"value": "{cart_total_currency_symbol}" | ||
}, | ||
{ | ||
"name": "Total", | ||
"value": "{cart_total}" | ||
}, | ||
{ | ||
"name": "Currency Name", | ||
"value": "{currency_name}" | ||
}, | ||
{ | ||
"name": "Currency Symbol", | ||
"value": "{currency_symbol}" | ||
}, | ||
{ | ||
"name": "Product Price", | ||
"value": "{product_price}" | ||
}, | ||
{ | ||
"name": "Product Title", | ||
"value": "{product_title}" | ||
} | ||
] | ||
} |
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
Oops, something went wrong.