-
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.
Merge pull request #63 from codex-storage/releases/v0.0.7
Releases/v0.0.7
- Loading branch information
Showing
11 changed files
with
354 additions
and
1,825 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { readFileSync } from 'fs'; | ||
import path, { dirname } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = dirname(__filename); | ||
|
||
test('download a file', async ({ page, browserName }) => { | ||
// https://github.com/microsoft/playwright/issues/13037 | ||
test.skip(browserName.toLowerCase() !== 'chromium', | ||
`Test only for chromium!`); | ||
|
||
await page.goto('/dashboard'); | ||
await page.locator('div').getByTestId("upload").setInputFiles([ | ||
path.join(__dirname, "assets", 'chatgpt.jpg'), | ||
]); | ||
await page.context().grantPermissions(["clipboard-read", "clipboard-write"]); | ||
await page.locator('.files-fileActions > button:nth-child(3)').first().click(); | ||
await page.getByRole('button', { name: 'Copy CID' }).click(); | ||
const handle = await page.evaluateHandle(() => navigator.clipboard.readText()); | ||
const cid = await handle.jsonValue() | ||
await page.locator('.sheets-container > .backdrop').click(); | ||
await page.getByPlaceholder('CID').click(); | ||
await page.getByPlaceholder('CID').fill(cid); | ||
const page1Promise = page.waitForEvent('popup'); | ||
const downloadPromise = page.waitForEvent('download'); | ||
await page.locator('div').filter({ hasText: /^Download a fileDownload$/ }).getByRole('button').click(); | ||
const page1 = await page1Promise; | ||
const download = await downloadPromise; | ||
expect(await download.failure()).toBeNull() | ||
}); |
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
Oops, something went wrong.