Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5bed44c

Browse files
committed
Fixing e2e tests
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parent6de93d1 commit5bed44c

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

‎site/e2e/constants.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export const users = {
2525
password:defaultPassword,
2626
email:"owner@coder.com",
2727
},
28+
admin:{
29+
username:"admin",
30+
password:defaultPassword,
31+
email:"admin@coder.com",
32+
},
2833
templateAdmin:{
2934
username:"template-admin",
3035
password:defaultPassword,

‎site/e2e/helpers.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ export async function importTemplate(
12041204
// organization.
12051205
constorgPicker=page.getByLabel("Belongs to *");
12061206
constorganizationsEnabled=awaitorgPicker.isVisible();
1207-
if(organizationsEnabled){
1207+
if(organizationsEnabled&&awaitorgPicker.isEnabled()){// The org picker is disabled if there is only one org.
12081208
if(orgName!==defaultOrganizationName){
12091209
thrownewError(
12101210
`No provisioners registered for${orgName}, creating this template will fail`,

‎site/e2e/tests/presets/prebuilds.spec.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ import {
1111
import{beforeCoderTest}from"../../hooks";
1212

1313
test.beforeEach(async({ page})=>{
14+
// TODO: we can improve things here by supporting using the standard web server BUT:
15+
// 1. we can't use the in-memory db because we didn't implement many dbmem functions
16+
// 2. we'd have to require terraform provisioners are setup (see requireTerraformTests)
17+
if(!test.info().config.webServer?.reuseExistingServer){
18+
console.warn('test requires existing server with terraform provisioners');
19+
test.skip()
20+
}
21+
1422
beforeCoderTest(page);
15-
awaitlogin(page);
23+
awaitlogin(page,users.admin);
1624
});
1725

1826
constwaitForBuildTimeout=120_000;// Builds can take a while, let's give them at most 2m.
@@ -28,6 +36,8 @@ const expectedPrebuilds = 2;
2836

2937
// NOTE: requires the `workspace-prebuilds` experiment enabled!
3038
test("create template with desired prebuilds",async({ page, baseURL})=>{
39+
test.setTimeout(300_000);
40+
3141
requiresLicense();
3242

3343
// Create new template.
@@ -124,7 +134,7 @@ test("claim prebuild matching selected preset", async ({ page, baseURL }) => {
124134
awaittext.waitFor({timeout:30_000});
125135

126136
// Logout as unprivileged user, and login as admin.
127-
awaitlogin(page,users.owner);
137+
awaitlogin(page,users.admin);
128138

129139
// Navigate back to prebuilds page to see that a new prebuild replaced the claimed one.
130140
awaitpage.goto(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp