File tree 5 files changed +47
-18
lines changed
5 files changed +47
-18
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import * as constants from "./constants"
4
4
5
5
const globalSetup = async ( ) : Promise < void > => {
6
6
axios . defaults . baseURL = `http://localhost:${ constants . basePort } `
7
+ // Create a user
7
8
await createFirstUser ( {
8
9
email : constants . email ,
9
10
username : constants . username ,
Original file line number Diff line number Diff line change
1
+ import { Page } from "@playwright/test"
2
+
3
+ export const urls = {
4
+ templates : "/templates" ,
5
+ starterTemplates : "/starter-templates" ,
6
+ dockerTemplate : "/starter-templates/docker" ,
7
+ createDockerTemplate : "/templates/new?exampleId=docker"
8
+ }
9
+
10
+ export const buttons = {
11
+ starterTemplates : "Starter templates" ,
12
+ dockerTemplate : "Develop in Docker" ,
13
+ useTemplate : "Use template" ,
14
+ createTemplate : "Create template"
15
+ }
16
+
17
+ export const clickButtonByText = async ( page : Page , text : string ) : Promise < void > => {
18
+ await page . click ( `button:has-text("${ text } ")` )
19
+ }
Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ const config: PlaywrightTestConfig = {
15
15
use : {
16
16
baseURL : `http://localhost:${ basePort } ` ,
17
17
video : "retain-on-failure" ,
18
- // use stored login after first test
19
- storageState : "e2e/storageState.json"
20
18
} ,
21
19
22
20
// `webServer` tells Playwright to launch a test server - more details here:
Original file line number Diff line number Diff line change
1
+ import { test } from "@playwright/test"
2
+ import { email , password } from "../constants"
3
+ import { SignInPage } from "../pom"
4
+ import { clickButtonByText , buttons , urls } from "../helpers" ;
5
+
6
+ test ( "Basic flow" , async ( { baseURL, page } ) => {
7
+ await page . goto ( baseURL + "/" , { waitUntil : "networkidle" } )
8
+
9
+ // Log-in with the default credentials we set up in the development server
10
+ const signInPage = new SignInPage ( baseURL , page )
11
+ await signInPage . submitBuiltInAuthentication ( email , password )
12
+
13
+ await page . waitForSelector ( "text=Workspaces" )
14
+
15
+ // create Docker template
16
+ await page . goto ( urls . templates ) ;
17
+ await clickButtonByText ( page , buttons . starterTemplates )
18
+
19
+ await page . goto ( urls . starterTemplates ) ;
20
+ await clickButtonByText ( page , buttons . dockerTemplate )
21
+
22
+ await page . goto ( urls . dockerTemplate ) ;
23
+ await clickButtonByText ( page , buttons . useTemplate )
24
+
25
+ await page . goto ( urls . createDockerTemplate ) ;
26
+ await clickButtonByText ( page , buttons . createTemplate )
27
+ } )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments