Skip to content

Commit 6b8432b

Browse files
fix(e2e): use environment-aware fixtures for staging tests
- Update transaction-details.spec.ts to use getDataFixturePath() - Skip data-dependent tests on staging (DB refreshed from production) - Profile tests skip on staging due to member state requirements Amp-Thread-ID: https://ampcode.com/threads/T-019bf47c-5314-713b-bcfb-031a3b3f2da2 Co-authored-by: Amp <amp@ampcode.com>
1 parent 278c039 commit 6b8432b

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

e2e/profile.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ test.use({
55
storageState: authFixtures.memberEdit,
66
})
77

8-
// Skip profile tests on staging - requires member-edit fixture with specific user state
9-
test.skip(isStagingEnv, 'Skipping on staging - requires member-edit fixture')
8+
// Skip profile tests on staging - member user state refreshed from production
9+
test.skip(
10+
isStagingEnv,
11+
'Skipping on staging - requires stable member-edit fixture'
12+
)
1013

1114
const user = {
1215
name: 'Zain Fathoni',

e2e/transaction-details.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ import { printRupiah } from '../app/utils/format'
33
import { readFixture } from '../app/utils/fixtures'
44
import { stripLeadingPlus } from '../app/utils/misc'
55
import { test, expect } from './base-test'
6-
import { authFixtures, isStagingEnv } from './fixtures'
6+
import { authFixtures, getDataFixturePath, isStagingEnv } from './fixtures'
77

88
test.use({
99
storageState: authFixtures.author,
1010
})
1111

1212
let memberSubmit: User, submitted: Transaction, rejected: Transaction
1313

14-
// Skip transaction-details tests on staging (no data fixtures available)
15-
test.skip(isStagingEnv, 'Skipping on staging - no data fixtures available')
14+
// Skip tests that verify specific fixture data on staging (data refreshed from production)
15+
test.describe.configure({ mode: 'serial' })
1616

1717
test.beforeAll(async () => {
1818
memberSubmit = JSON.parse(
19-
await readFixture(`../../e2e/fixtures/users/member-submit.local.json`)
19+
await readFixture(getDataFixturePath('users', 'member-submit'))
2020
)
2121
submitted = JSON.parse(
22-
await readFixture(`../../e2e/fixtures/transactions/submitted.local.json`)
22+
await readFixture(getDataFixturePath('transactions', 'submitted'))
2323
)
2424
rejected = JSON.parse(
25-
await readFixture(`../../e2e/fixtures/transactions/rejected.local.json`)
25+
await readFixture(getDataFixturePath('transactions', 'rejected'))
2626
)
2727
})
2828

@@ -35,6 +35,7 @@ test('redirected to TransactionList page when transaction data with id of $trans
3535
expect(page.url()).toBe(`${baseURL}/dashboard/transactions`)
3636
})
3737

38+
test.skip(isStagingEnv, 'Skipping on staging - requires stable fixture data')
3839
test('render transaction data if transaction data exists', async ({ page }) => {
3940
await page.goto(`/dashboard/transactions/${submitted.id}`)
4041

0 commit comments

Comments
 (0)