-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94dee67
commit ff2ac69
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { test, expect, Page } from '@playwright/test'; | ||
import { host } from './helpers'; | ||
|
||
test.describe('Basic Functionality', () => { | ||
test('should copy files', async ({ page, context }) => { | ||
await page.goto(`${host}/n`); | ||
await page.waitForSelector('button:has-text("Run Code")'); | ||
|
||
// let monaco load | ||
await page.waitForTimeout(500); | ||
|
||
await page.click('[data-test-id="input-editor"]'); | ||
await page.keyboard.type('1 2 3'); | ||
|
||
await page.evaluate( | ||
`this.monaco.editor.getModels().find(x => x.getLanguageId() === "cpp").setValue(\`code_value\`)` | ||
); | ||
await page.evaluate( | ||
`this.monaco.editor.getModels().find(x => x.getLanguageId() === "plaintext").setValue(\`input_value\`)` | ||
); | ||
|
||
// sync with yjs server | ||
await page.waitForTimeout(1500); | ||
|
||
await page.goto(page.url() + '/copy'); | ||
await page.waitForSelector('button:has-text("Run Code")'); | ||
|
||
expect(await page.$('text="code_value"')).toBeTruthy(); | ||
expect(await page.$('text="input_value"')).toBeTruthy(); | ||
}); | ||
}); |