Skip to content

Commit 985f280

Browse files
committed
Update internal.spec.ts
1 parent 641e137 commit 985f280

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

packages/gitbook/e2e/internal.spec.ts

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,9 +1983,7 @@ const testCases: TestsCase[] = [
19831983
await expect(page.locator('#gitbook-widget-window')).toBeVisible();
19841984
const iframe = page.frameLocator('#gitbook-widget-iframe');
19851985
await iframe.getByTestId('embed-tab-docs').click(); // Switch to docs tab
1986-
await expect(iframe.getByTestId('embed-docs-page')).toBeVisible({
1987-
timeout: 20000,
1988-
});
1986+
await expect(iframe.getByTestId('embed-docs-page')).toBeVisible();
19891987

19901988
await iframe.getByTestId('embed-tab-assistant').click(); // Switch to assistant tab
19911989
await expect(iframe.getByTestId('ai-chat')).toBeVisible();
@@ -2002,14 +2000,14 @@ const testCases: TestsCase[] = [
20022000
GitBook('navigateToPage', '/getting-started/quickstart');
20032001
});
20042002
await expect(page.locator('#gitbook-widget-window')).toBeVisible();
2005-
const iframe = page.frameLocator('#gitbook-widget-iframe');
2006-
await expect(iframe.getByTestId('embed-docs-page')).toBeVisible({
2007-
timeout: 20000,
2003+
await expect(
2004+
page.frameLocator('#gitbook-widget-iframe').getByTestId('embed-docs-page')
2005+
).toBeVisible({
2006+
timeout: 10000,
20082007
});
2009-
await expect(iframe.owner()).toHaveAttribute(
2010-
'src',
2011-
expect.stringContaining('getting-started/quickstart')
2012-
);
2008+
await expect(
2009+
page.frameLocator('#gitbook-widget-iframe').owner()
2010+
).toHaveAttribute('src', expect.stringContaining('getting-started/quickstart'));
20132011
},
20142012
},
20152013
{
@@ -2218,9 +2216,7 @@ const testCases: TestsCase[] = [
22182216
run: async (page) => {
22192217
await expect(page.locator('#gitbook-widget-window')).toBeVisible();
22202218
const iframe = page.frameLocator('#gitbook-widget-iframe');
2221-
await expect(iframe.getByTestId('embed-docs-page')).toBeVisible({
2222-
timeout: 20000,
2223-
});
2219+
await expect(iframe.getByTestId('embed-docs-page')).toBeVisible();
22242220
},
22252221
},
22262222
{
@@ -2229,9 +2225,7 @@ const testCases: TestsCase[] = [
22292225
run: async (page) => {
22302226
await expect(page.locator('#gitbook-widget-window')).toBeVisible();
22312227
const iframe = page.frameLocator('#gitbook-widget-iframe');
2232-
await expect(iframe.getByTestId('embed-docs-page')).toBeVisible({
2233-
timeout: 20000,
2234-
});
2228+
await expect(iframe.getByTestId('embed-docs-page')).toBeVisible();
22352229
const tocButton = iframe.getByTestId('toc-button');
22362230
await expect(tocButton).toBeVisible();
22372231
await tocButton.click();
@@ -2244,9 +2238,7 @@ const testCases: TestsCase[] = [
22442238
run: async (page) => {
22452239
await expect(page.locator('#gitbook-widget-window')).toBeVisible();
22462240
const iframe = page.frameLocator('#gitbook-widget-iframe');
2247-
await expect(iframe.getByTestId('embed-docs-page')).toBeVisible({
2248-
timeout: 20000,
2249-
});
2241+
await expect(iframe.getByTestId('embed-docs-page')).toBeVisible();
22502242
const openInNewTabButton = iframe.getByTestId(
22512243
'embed-docs-page-open-in-new-tab'
22522244
);

0 commit comments

Comments
 (0)