diff --git a/packages/cli-e2e/__tests__/atomic.specs.ts b/packages/cli-e2e/__tests__/atomic.specs.ts index ce8c34fba3..2bfec0360a 100644 --- a/packages/cli-e2e/__tests__/atomic.specs.ts +++ b/packages/cli-e2e/__tests__/atomic.specs.ts @@ -1,7 +1,10 @@ import type {Browser, Page, HTTPResponse} from 'puppeteer'; import {captureScreenshots, getNewBrowser, openNewPage} from '../utils/browser'; import {answerPrompt, getProjectPath, setupUIProject} from '../utils/cli'; -import {isSuccessfulSearchResponse} from '../utils/platform'; +import { + isSearchRequestOrResponse, + isSuccessfulSearchResponse, +} from '../utils/platform'; import {ProcessManager} from '../utils/processManager'; import {Terminal} from '../utils/terminal/terminal'; import {BrowserConsoleInterceptor} from '../utils/browserConsoleInterceptor'; @@ -21,6 +24,7 @@ interface BuildAppOptions { describe('ui:create:atomic', () => { const searchPageEndpoint = 'http://localhost:3333'; const searchInterfaceSelector = 'atomic-search-interface'; + const atomicResult = 'atomic-result'; let normalizedProjectDir = ''; let originalProjectDir = ''; const normalizeProjectDirectory = (buildAppOptions: BuildAppOptions) => { @@ -330,8 +334,7 @@ describe('ui:create:atomic', () => { it('should send a search query when the page is loaded', async () => { await page.goto(searchPageEndpoint, {waitUntil: 'networkidle2'}); - await page.waitForSelector(searchInterfaceSelector); - + await page.waitForResponse(isSearchRequestOrResponse); expect( interceptedResponse.some(isSuccessfulSearchResponse) ).toBeTruthy();