chore(ui): run subdomain pagination only in oss and not on aut#26599
chore(ui): run subdomain pagination only in oss and not on aut#26599
Conversation
| const SUBDOMAIN_COUNT = 60; | ||
|
|
||
| test.describe('SubDomain Pagination', () => { | ||
| if (process.env.PLAYWRIGHT_IS_OSS) { |
There was a problem hiding this comment.
⚠️ Bug: test.describe inside if block skips test.slow and hooks
Wrapping the entire test.describe block inside if (process.env.PLAYWRIGHT_IS_OSS) works, but the idiomatic Playwright approach is to use test.skip inside the describe block. The current approach means Playwright won't even register the test suite when the env var is falsy, which can cause confusing behavior in test reports (tests silently disappear rather than showing as skipped).
Consider using test.describe with a conditional skip instead, so the tests are always registered but explicitly skipped when not running in OSS mode. This gives better visibility in CI reports.
Suggested fix:
test.describe('SubDomain Pagination', () => {
test.skip(!process.env.PLAYWRIGHT_IS_OSS, 'Only runs in OSS mode');
test.slow(true);
// ... rest of tests unchanged
});
Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion
There was a problem hiding this comment.
Pull request overview
This PR updates a Playwright E2E spec so the “SubDomain Pagination” suite only runs in OSS environments, and adjusts the expected search request made when opening the Subdomains tab.
Changes:
- Gate the entire
SubDomain Paginationtest suite behindprocess.env.PLAYWRIGHT_IS_OSS. - Update the
waitForResponseURL matcher for the initial subdomain search request.
You can also share your feedback on Copilot code review. Take the survey.
| const subDomainRes = page.waitForResponse( | ||
| '/api/v1/search/query?q=&index=domain&from=0&size=9*' | ||
| '/api/v1/search/query?q=&index=domain_search_index&from=0&size=9*' | ||
| ); |
| if (process.env.PLAYWRIGHT_IS_OSS) { | ||
| test.describe('SubDomain Pagination', () => { | ||
| test.slow(true); | ||
|
|
🟡 Playwright Results — all passed (21 flaky)✅ 3388 passed · ❌ 0 failed · 🟡 21 flaky · ⏭️ 183 skipped
🟡 21 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
There was a problem hiding this comment.
Pull request overview
Updates a Playwright E2E spec so the SubDomain pagination scenario only executes in OSS runs, avoiding running it in AUT/non-OSS environments.
Changes:
- Wrap SubDomain pagination setup/teardown and the test itself behind
process.env.PLAYWRIGHT_IS_OSS. - Update the expected
/search/queryURL pattern used inwaitForResponsefor the initial subdomain tab load. - Re-indent the spec due to the added conditional block.
| const subDomainRes = page.waitForResponse( | ||
| '/api/v1/search/query?q=&index=domain_search_index&from=0&size=9*' | ||
| ); |
There was a problem hiding this comment.
page.waitForResponse is waiting for index=domain_search_index, but the UI search requests for domains use SearchIndex.DOMAIN which serializes to index=domain (see src/rest/domainAPI.ts and src/enums/search.enum.ts). As written, this response wait can time out if the actual request uses index=domain, causing the test to flake/fail. Update the expected URL/predicate to match the real request (and consider using a predicate that checks index=domain plus from/size without relying on exact query param order).
| const subDomainRes = page.waitForResponse( | |
| '/api/v1/search/query?q=&index=domain_search_index&from=0&size=9*' | |
| ); | |
| const subDomainRes = page.waitForResponse((response) => { | |
| const url = response.url(); | |
| return ( | |
| url.includes('/api/v1/search/query') && | |
| url.includes('index=domain') && | |
| url.includes('from=0') && | |
| url.includes('size=9') | |
| ); | |
| }); |
|
|
||
| test.beforeAll('Setup domain and subdomains', async ({ browser }) => { | ||
| test.slow(true); | ||
| if(process.env.PLAYWRIGHT_IS_OSS) { |
There was a problem hiding this comment.
Code style: if(process.env.PLAYWRIGHT_IS_OSS) { doesn’t match the formatting used across the Playwright suite (if (...) {) and is likely to be rewritten by Prettier/CI formatting checks. Please apply standard spacing here.
| if(process.env.PLAYWRIGHT_IS_OSS) { | |
| if (process.env.PLAYWRIGHT_IS_OSS) { |
Code Review
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|



No description provided.