mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
[playground] Wait for Monaco to fully load (#32584)
I'm not sure what exactly is causing the flakiness in the playground e2e tests but I suspect it's some kind of timing issue. Let's try waiting for Monaco to be fully initialized before running tests. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32584). * __->__ #32584 * #32583
This commit is contained in:
parent
e0e98d9560
commit
26bca0005c
|
|
@ -105,6 +105,9 @@ function nonReactFn() {
|
|||
|
||||
test('editor should open successfully', async ({page}) => {
|
||||
await page.goto(`/`, {waitUntil: 'networkidle'});
|
||||
await page.waitForFunction(
|
||||
() => typeof window['MonacoEnvironment'] !== 'undefined',
|
||||
);
|
||||
await page.screenshot({
|
||||
fullPage: true,
|
||||
path: 'test-results/00-fresh-page.png',
|
||||
|
|
@ -120,6 +123,9 @@ test('editor should compile from hash successfully', async ({page}) => {
|
|||
};
|
||||
const hash = encodeStore(store);
|
||||
await page.goto(`/#${hash}`, {waitUntil: 'networkidle'});
|
||||
await page.waitForFunction(
|
||||
() => typeof window['MonacoEnvironment'] !== 'undefined',
|
||||
);
|
||||
|
||||
// User input from hash compiles
|
||||
await page.screenshot({
|
||||
|
|
@ -143,6 +149,9 @@ test('reset button works', async ({page}) => {
|
|||
};
|
||||
const hash = encodeStore(store);
|
||||
await page.goto(`/#${hash}`, {waitUntil: 'networkidle'});
|
||||
await page.waitForFunction(
|
||||
() => typeof window['MonacoEnvironment'] !== 'undefined',
|
||||
);
|
||||
|
||||
// Reset button works
|
||||
page.on('dialog', dialog => dialog.accept());
|
||||
|
|
@ -166,6 +175,9 @@ TEST_CASE_INPUTS.forEach((t, idx) =>
|
|||
};
|
||||
const hash = encodeStore(store);
|
||||
await page.goto(`/#${hash}`, {waitUntil: 'networkidle'});
|
||||
await page.waitForFunction(
|
||||
() => typeof window['MonacoEnvironment'] !== 'undefined',
|
||||
);
|
||||
await page.screenshot({
|
||||
fullPage: true,
|
||||
path: `test-results/03-0${idx}-${t.name}.png`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user