Skip to content

Commit 4e3bb57

Browse files
authored
feat: fix specs & skip copy PW config when using examples [kit-2292] (#1166)
1 parent 7156864 commit 4e3bb57

File tree

8 files changed

+18
-8
lines changed

8 files changed

+18
-8
lines changed

examples/advanced-project-js/checkly.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ const config = defineConfig({
5151
//Use `testCommand: npx playwright test` to filter the tests you want to run
5252
}
5353
],
54-
],
5554
},
5655
cli: {
5756
/* The default datacenter location to use when running npx checkly test */

examples/advanced-project-js/src/playwright/homepage.spec.js renamed to examples/advanced-project-js/src/tests/homepage.spec.js

File renamed without changes.

examples/advanced-project-js/src/playwright/login.spec.js renamed to examples/advanced-project-js/src/tests/login.spec.js

File renamed without changes.

examples/advanced-project/checkly.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ const config = defineConfig({
3535
playwrightConfig: {
3636
timeout: 30000,
3737
use: {
38-
baseURL: 'https://www.danube-web.shop',
38+
baseURL: "https://www.checklyhq.com",
3939
viewport: { width: 1280, height: 720 },
40-
}
40+
},
4141
},
4242
browserChecks: {
4343
/* A glob pattern matches any Playwright .spec.ts files and automagically creates a Browser Check. This way, you

examples/advanced-project/playwright.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export default defineConfig({
2020
baseURL: "https://www.checklyhq.com",
2121
viewport: { width: 1280, height: 720 },
2222
trace: "on",
23-
2423
},
2524
projects: [
2625
{

examples/boilerplate-project-js/checkly.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ const config = defineConfig({
2727
/* A glob pattern that matches the Checks inside your repo, see https://www.checklyhq.com/docs/cli/using-check-test-match/ */
2828
checkMatch: '**/__checks__/**/*.check.js',
2929
/* Global configuration option for Playwright-powered checks. See https://www.checklyhq.com/docs/browser-checks/playwright-test/#global-configuration */
30-
playwrightConfig: {},
30+
playwrightConfig: {
31+
use: {
32+
baseURL: "https://www.checklyhq.com",
33+
viewport: { width: 1280, height: 720 },
34+
},
35+
},
3136
browserChecks: {
3237
/* A glob pattern matches any Playwright .spec.js files and automagically creates a Browser Check. This way, you
3338
* can just write native Playwright code. See https://www.checklyhq.com/docs/cli/using-check-test-match/

examples/boilerplate-project/checkly.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ const config = defineConfig({
2727
/* A glob pattern that matches the Checks inside your repo, see https://www.checklyhq.com/docs/cli/using-check-test-match/ */
2828
checkMatch: '**/__checks__/**/*.check.ts',
2929
/* Global configuration option for Playwright-powered checks. See https://www.checklyhq.com/docs/browser-checks/playwright-test/#global-configuration */
30-
playwrightConfig: {},
30+
playwrightConfig: {
31+
use: {
32+
baseURL: "https://www.checklyhq.com",
33+
viewport: { width: 1280, height: 720 },
34+
},
35+
},
3136
browserChecks: {
3237
/* A glob pattern matches any Playwright .spec.ts files and automagically creates a Browser Check. This way, you
3338
* can just write native Playwright code. See https://www.checklyhq.com/docs/cli/using-check-test-match/

packages/create-cli/src/commands/bootstrap.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ export default class Bootstrap extends Command {
103103
}
104104

105105
const projectDirectory = await getProjectDirectory({ onCancel })
106+
const existingProject = hasPackageJsonFile(projectDirectory)
106107

107-
if (hasPackageJsonFile(projectDirectory)) {
108+
if (existingProject) {
108109
// Init Checkly CLI for an existing project
109110
await installWithinProject({ projectDirectory, version, onCancel })
110111
} else {
@@ -115,7 +116,8 @@ export default class Bootstrap extends Command {
115116
await installDependenciesAndInitGit({ projectDirectory })
116117

117118
const playwrightConfig = getPlaywrightConfig(projectDirectory)
118-
if (playwrightConfig) {
119+
// Only prompt playwright copy when not using exampels
120+
if (playwrightConfig && existingProject) {
119121
await copyPlaywrightConfig({ projectDirectory, playwrightConfig })
120122
}
121123

0 commit comments

Comments
 (0)