Skip to content

feat: Implement basic e2e scenario #7199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes
  • Loading branch information
mtojek committed Apr 20, 2023
commit a022d142ffcd2d4f7ae3e28d45bfbdfcf49324c2
1 change: 1 addition & 0 deletions site/e2e/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Default port from the server
export const defaultPort = 3000
export const defaultEndpoint = `localhost:${defaultPort}`

// Credentials for the first user
export const username = "admin"
Expand Down
24 changes: 0 additions & 24 deletions site/e2e/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
import { Page } from "@playwright/test"
import path from "path"

export const buttons = {
starterTemplates: "Starter templates",
dockerTemplate: "Develop in Docker",
useTemplate: "Use template",
createTemplate: "Create template",
createWorkspace: "Create workspace",
submitCreateWorkspace: "Create workspace",
stopWorkspace: "Stop",
startWorkspace: "Start",
}

export const clickButton = async (page: Page, name: string): Promise<void> => {
await page.getByRole("button", { name, exact: true }).click()
}

export const fillInput = async (
page: Page,
label: string,
value: string,
): Promise<void> => {
await page.fill(`text=${label}`, value)
}

const statesDir = path.join(__dirname, "./states")

export const getStatePath = (name: string): string => {
Expand Down
4 changes: 2 additions & 2 deletions site/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PlaywrightTestConfig } from "@playwright/test"
import path from "path"
import { defaultPort } from "./constants"
import { defaultPort, defaultEndpoint } from "./constants"

const port = process.env.CODER_E2E_PORT
? Number(process.env.CODER_E2E_PORT)
Expand All @@ -12,7 +12,7 @@ const config: PlaywrightTestConfig = {
testDir: "tests",
globalSetup: require.resolve("./globalSetup"),
use: {
baseURL: `http://localhost:${port}`,
baseURL: `http://${defaultEndpoint}`,
video: {
mode: "retain-on-failure",
size: { width: 1280, height: 768 },
Expand Down
17 changes: 0 additions & 17 deletions site/e2e/pom/SignInPage.ts

This file was deleted.

Empty file removed site/e2e/states/.gitkeep
Empty file.