-
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.
Merge pull request #118 from cpinitiative/fix-copy
Fix copying files
- Loading branch information
Showing
11 changed files
with
102 additions
and
47 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
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
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(); | ||
}); | ||
}); |
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
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
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
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
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
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
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,10 @@ | ||
const useFirebaseEmulatorInDev = true; | ||
const useYjsDevSerInDev = false; | ||
|
||
export const SHOULD_USE_FIREBASE_EMULATOR = | ||
typeof window !== 'undefined' && | ||
location.hostname === 'localhost' && | ||
useFirebaseEmulatorInDev; | ||
export const SHOULD_USE_DEV_YJS_SERVER = | ||
(process.env.NODE_ENV !== 'production' && useYjsDevSerInDev) || | ||
process.env.IS_TEST_ENV; |
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
67c2661
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ide – ./
ide-psi.vercel.app
ide-cpinitiative.vercel.app
ide-git-master-cpinitiative.vercel.app
beta.ide.usaco.guide
ide.usaco.guide