Skip to content

Commit

Permalink
Feat playwright tests (#37)
Browse files Browse the repository at this point in the history
* feat: Playwright E2E Tests

* feat: Playwright E2E Tests

* final updates

* Updating workflows

* fixing definition
  • Loading branch information
xoscar authored Jan 10, 2024
1 parent c084086 commit 71944d6
Show file tree
Hide file tree
Showing 7 changed files with 1,451 additions and 590 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Playwright Tests
on:
workflow_dispatch:
schedule:
- cron: "0 */1 * * *" # every hour

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
env:
TRACETEST_API_TOKEN: ${{secrets.TRACETEST_TOKEN}}
POKESHOP_DEMO_URL: ${{secrets.POKESHOP_DEMO_URL}}
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Send message on Slack in case of failure
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
# check the block kit builder docs to understand how it works
# and how to modify it: https://api.slack.com/block-kit
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":warning: Synthetic Monitoring Alert - E2E Playwright - Pokeshop Demo :warning:",
"emoji": true
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Status:*\nFailed"
},
{
"type": "mrkdwn",
"text": "*Pipeline:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SYNTETIC_MONITORING_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ api/.build/

cypress/screenshots
cypress/downloads
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
2 changes: 1 addition & 1 deletion cypress/e2e/1-getting-started/home.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('Home', { defaultCommandTimeout: 60000 }, () => {
cy.get('button').contains('OK').click({ force: true });
});

it('deletes a pokemon (2)', () => {
it('deletes a pokemon', () => {
cy.get('[data-cy="pokemon-list"]').should('be.visible');
cy.get('[data-cy="pokemon-card"]').first().click().get('[data-cy="delete-pokemon-button"]').first().click();
});
Expand Down
Loading

0 comments on commit 71944d6

Please sign in to comment.