Skip to content

Commit dd9a2c3

Browse files
committed
feat(e2e): add download test
1 parent f7417d1 commit dd9a2c3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/e2e/downloads.test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as path from "path"
2+
import { promises as fs } from "fs"
3+
import { clean } from "../utils/helpers"
4+
import { describe, test, expect } from "./baseFixture"
5+
6+
describe("Downloads", true, [], {}, async () => {
7+
const testName = "downloads"
8+
test.beforeAll(async () => {
9+
await clean(testName)
10+
})
11+
12+
test("should see the 'Download...' option", async ({ codeServerPage }) => {
13+
// Setup
14+
const workspaceDir = await codeServerPage.workspaceDir
15+
const tmpFilePath = path.join(workspaceDir, "unique-file.txt")
16+
await fs.writeFile(tmpFilePath, "hello world")
17+
18+
// Action
19+
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
20+
await fileInExplorer.click({
21+
button: "right",
22+
})
23+
24+
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(true)
25+
})
26+
})

0 commit comments

Comments
 (0)