-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
4 changed files
with
55 additions
and
2 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
50 changes: 50 additions & 0 deletions
50
browser-extension/chrome-extension-test/tests/submission_details.spec.ts
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,50 @@ | ||
import { test, expect } from '../fixtures'; | ||
import { Page, Locator } from "@playwright/test"; | ||
|
||
require('dotenv').config({ path: './.env' }); | ||
|
||
// chromium.launch PersistentContext prevents you from using multiple pages, so do not use parallel mode. | ||
// The parallel mode opens each tab for each test, and the context will be closed after one test. | ||
test.describe.configure({ mode: 'serial' }); | ||
|
||
let page: Page; | ||
|
||
test.beforeAll(async ({ context }) => { | ||
page = await context.newPage(); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await page.close(); | ||
}); | ||
|
||
test.describe('Extension functions correctly on the submission details page', () => { | ||
test.describe('Copy button', () => { | ||
test('Copy input', async () => { | ||
page.goto('https://atcoder.jp/contests/abc347/submissions/51807898'); | ||
const copyButton: Locator = page.locator('#copy_in_0'); | ||
const copiedButton: Locator = page.locator('#copied_in_0'); | ||
await copyButton.dispatchEvent('click'); | ||
await expect(copiedButton).toBeVisible(); | ||
expect(await page.evaluate(() => navigator.clipboard.readText())).toContain("yay"); | ||
}); | ||
test('Copy output', async () => { | ||
page.goto('https://atcoder.jp/contests/abc347/submissions/51807898'); | ||
const copyButton: Locator = page.locator('#copy_out_0'); | ||
const copiedButton: Locator = page.locator('#copied_out_0'); | ||
await copyButton.dispatchEvent('click'); | ||
await expect(copiedButton).toBeVisible(); | ||
expect(await page.evaluate(() => navigator.clipboard.readText())).toContain("5"); | ||
}); | ||
}); | ||
|
||
|
||
// test('Download button', async () => { | ||
// page.goto('https://atcoder.jp/contests/abc347/submissions/51807898'); | ||
|
||
// }); | ||
|
||
// test('Debug button', async () => { | ||
// page.goto('https://atcoder.jp/contests/abc347/submissions/51807898'); | ||
|
||
// }); | ||
}); |
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
1 change: 0 additions & 1 deletion
1
browser-extension/chrome-extension/scripts/submission-details/main.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
(async () => { | ||
const tcpub = await isTestCasePublished(getContestName(), getProblemName()); | ||
if (!tcpub) { | ||
|