Skip to content

Commit

Permalink
chore: try running the test in Chrome only
Browse files Browse the repository at this point in the history
  • Loading branch information
JuroUhlar committed Jan 3, 2024
1 parent 2b966ca commit bfe09ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ jobs:
run: yarn build

- name: Run Playwright tests
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
run: npx playwright test --grep-invert CHROME_ONLY --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}

# Some tests are only run on Chrome, marked with CHROME_ONLY in their name
- name: Run Chrome-only Playwright tests
run: npx playwright test --grep CHROME_ONLY --project='chromium'

- name: Upload Playwright report
uses: actions/upload-artifact@v3
Expand Down
9 changes: 7 additions & 2 deletions e2e/bot-firewall.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ import { resetScenarios } from './resetHelper';
import { TEST_IDS } from '../src/client/testIDs';
import { BOT_FIREWALL_COPY } from '../src/client/bot-firewall/botFirewallCopy';

test.describe('Bot Firewall Demo', () => {
/**
* CHROME_ONLY flag tells the GitHub action to run this test only using Chrome.
* Since this test relies on a single common Cloudflare ruleset we need to prevent it from running in multiple browsers in parallel,
* they would trip over each other and fail.
*/
test.describe('Bot Firewall Demo CHROME_ONLY', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/coupon-fraud');
await resetScenarios(page);
});

test('Should display bot visit a allow blocking IP address', async ({ page, context }) => {
test('Should display bot visit and allow blocking/unblocking its IP address', async ({ page, context }) => {
// Record bot visit in web-scraping page
await page.goto('/web-scraping');
await expect(page.getByTestId(TEST_IDS.common.alert)).toContainText('Malicious bot detected');
Expand Down

0 comments on commit bfe09ef

Please sign in to comment.