create-vue 3.6.4 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +211 -1
- package/outfile.cjs +830 -8
- package/package.json +4 -3
- package/template/base/node_modules/.bin/vite +4 -4
- package/template/base/package.json +2 -2
- package/template/base/vite.config.js.data.mjs +9 -0
- package/template/base/{vite.config.js → vite.config.js.ejs} +8 -2
- package/template/code/default/src/components/HelloWorld.vue +1 -0
- package/template/code/router/src/components/HelloWorld.vue +1 -0
- package/template/code/router/src/components/WelcomeItem.vue +1 -0
- package/template/code/typescript-default/src/components/HelloWorld.vue +1 -0
- package/template/code/typescript-default/src/components/WelcomeItem.vue +1 -0
- package/template/code/typescript-router/src/components/HelloWorld.vue +1 -0
- package/template/code/typescript-router/src/components/WelcomeItem.vue +1 -0
- package/template/config/cypress/node_modules/.bin/cypress +4 -4
- package/template/config/cypress/package.json +1 -1
- package/template/config/cypress-ct/node_modules/.bin/cypress +4 -4
- package/template/config/cypress-ct/package.json +2 -2
- package/template/config/jsx/node_modules/.bin/vite +4 -4
- package/template/config/jsx/package.json +2 -2
- package/template/config/jsx/vite.config.js.data.mjs +15 -0
- package/template/config/nightwatch/.vscode/extensions.json +3 -0
- package/template/config/nightwatch/_gitignore +2 -0
- package/template/config/nightwatch/nightwatch/custom-assertions/elementHasCount.js +45 -0
- package/template/config/nightwatch/nightwatch/custom-assertions/elementHasCount.ts +43 -0
- package/template/config/nightwatch/nightwatch/custom-commands/strictClick.js +19 -0
- package/template/config/nightwatch/nightwatch/custom-commands/strictClick.ts +18 -0
- package/template/config/nightwatch/nightwatch/globals.js +23 -0
- package/template/config/nightwatch/nightwatch/nightwatch.d.ts +11 -0
- package/template/config/nightwatch/nightwatch.conf.js +152 -0
- package/template/config/nightwatch/node_modules/.bin/browserslist +17 -0
- package/template/config/nightwatch/node_modules/.bin/chromedriver +17 -0
- package/template/config/nightwatch/node_modules/.bin/geckodriver +17 -0
- package/template/config/nightwatch/node_modules/.bin/nightwatch +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node-cwd +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node-esm +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node-script +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-node-transpile-only +17 -0
- package/template/config/nightwatch/node_modules/.bin/ts-script +17 -0
- package/template/config/nightwatch/node_modules/.bin/tsc +17 -0
- package/template/config/nightwatch/node_modules/.bin/tsserver +17 -0
- package/template/config/nightwatch/node_modules/.bin/vite +17 -0
- package/template/config/nightwatch/node_modules/.bin/wait-on +17 -0
- package/template/config/nightwatch/package.json +15 -0
- package/template/config/nightwatch/tests/e2e/example.js +14 -0
- package/template/config/nightwatch/vite.config.js.data.mjs +12 -0
- package/template/config/nightwatch-ct/nightwatch/index.html +16 -0
- package/template/config/nightwatch-ct/package.json +8 -0
- package/template/config/nightwatch-ct/src/components/__tests__/HelloWorld.spec.js +14 -0
- package/template/config/nightwatch-ct/vite.config.js.data.mjs +16 -0
- package/template/config/pinia/package.json +2 -2
- package/template/config/playwright/node_modules/.bin/playwright +4 -4
- package/template/config/playwright/package.json +1 -1
- package/template/config/router/package.json +2 -2
- package/template/config/typescript/node_modules/.bin/vue-tsc +4 -4
- package/template/config/typescript/package.json +2 -2
- package/template/config/vitest/node_modules/.bin/vitest +4 -4
- package/template/config/vitest/package.json +3 -3
- package/template/config/vitest/vitest.config.js +2 -2
- package/template/tsconfig/base/tsconfig.node.json +7 -1
- package/template/tsconfig/nightwatch/nightwatch/tsconfig.json +16 -0
- package/template/tsconfig/nightwatch/tsconfig.json +17 -0
- package/template/tsconfig/nightwatch-ct/tsconfig.app.json +12 -0
- package/template/tsconfig/nightwatch-ct/tsconfig.json +14 -0
- package/template/config/jsx/vite.config.js +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vue",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "An easy way to start a Vue project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -26,11 +26,12 @@
|
|
|
26
26
|
"homepage": "https://github.com/vuejs/create-vue#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@tsconfig/node18": "^2.0.1",
|
|
29
|
-
"@types/eslint": "^8.
|
|
30
|
-
"@types/node": "^18.16.
|
|
29
|
+
"@types/eslint": "^8.40.1",
|
|
30
|
+
"@types/node": "^18.16.17",
|
|
31
31
|
"@types/prompts": "^2.4.4",
|
|
32
32
|
"@vue/create-eslint-config": "^0.2.1",
|
|
33
33
|
"@vue/tsconfig": "^0.4.0",
|
|
34
|
+
"ejs": "^3.1.9",
|
|
34
35
|
"esbuild": "^0.17.18",
|
|
35
36
|
"esbuild-plugin-license": "^1.2.2",
|
|
36
37
|
"husky": "^8.0.3",
|
|
@@ -6,12 +6,12 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.
|
|
11
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@4.3.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/bin/vite.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../node_modules/.pnpm/vite@4.3.
|
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/bin/vite.js" "$@"
|
|
17
17
|
fi
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { fileURLToPath, URL } from 'node:url'
|
|
2
2
|
|
|
3
3
|
import { defineConfig } from 'vite'
|
|
4
|
-
|
|
4
|
+
<%_ for (const { importer } of plugins) { _%>
|
|
5
|
+
<%- importer %>
|
|
6
|
+
<%_ } _%>
|
|
5
7
|
|
|
6
8
|
// https://vitejs.dev/config/
|
|
7
9
|
export default defineConfig({
|
|
8
|
-
plugins: [
|
|
10
|
+
plugins: [
|
|
11
|
+
<%_ for (const { initializer } of plugins) { _%>
|
|
12
|
+
<%- initializer _%>,
|
|
13
|
+
<%_ } _%>
|
|
14
|
+
],
|
|
9
15
|
resolve: {
|
|
10
16
|
alias: {
|
|
11
17
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
@@ -6,12 +6,12 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.
|
|
11
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@12.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/bin/cypress" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@12.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/bin/cypress" "$@"
|
|
17
17
|
fi
|
|
@@ -6,12 +6,12 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.
|
|
11
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/cypress@12.14.0/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@12.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/bin/cypress" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@12.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/cypress@12.14.0/node_modules/cypress/bin/cypress" "$@"
|
|
17
17
|
fi
|
|
@@ -6,12 +6,12 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.
|
|
11
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@4.3.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/bin/vite.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../../node_modules/.pnpm/vite@4.3.
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/vite@4.3.9_@types+node@18.16.17/node_modules/vite/bin/vite.js" "$@"
|
|
17
17
|
fi
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function getData({ oldData }) {
|
|
2
|
+
const vueJsxPlugin = {
|
|
3
|
+
name: 'vueJsx',
|
|
4
|
+
importer: "import vueJsx from '@vitejs/plugin-vue-jsx'",
|
|
5
|
+
initializer: 'vueJsx()'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
return {
|
|
9
|
+
...oldData,
|
|
10
|
+
// Append the vueJsx plugin right after the vue plugin
|
|
11
|
+
plugins: oldData.plugins.flatMap((plugin) =>
|
|
12
|
+
plugin.id === 'vue' ? [plugin, vueJsxPlugin] : plugin
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom Nightwatch assertion. The assertion name is the filename.
|
|
3
|
+
*
|
|
4
|
+
* Example usage:
|
|
5
|
+
* browser.assert.elementHasCount(selector, count)
|
|
6
|
+
*
|
|
7
|
+
* For more information on custom assertions see:
|
|
8
|
+
* https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-assertions.html
|
|
9
|
+
*
|
|
10
|
+
* @param {string} selector
|
|
11
|
+
* @param {number} count
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
exports.assertion = function elementHasCount(selector, count) {
|
|
15
|
+
// Message to be displayed on the console while running this assertion.
|
|
16
|
+
this.message = `Testing if element <${selector}> has count: ${count}`
|
|
17
|
+
|
|
18
|
+
// Expected value of the assertion, to be displayed in case of failure.
|
|
19
|
+
this.expected = count
|
|
20
|
+
|
|
21
|
+
// Given the result value (from `this.value` below), this function will
|
|
22
|
+
// evaluate if the assertion has passed.
|
|
23
|
+
this.evaluate = function (value) {
|
|
24
|
+
return value === count
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Retrieve the value from the result object we got after running the
|
|
28
|
+
// assertion command (defined below), which is to be evaluated against
|
|
29
|
+
// the value passed into the assertion as the second argument.
|
|
30
|
+
this.value = function (result) {
|
|
31
|
+
return result.value
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Script to be executed in the browser to find the actual element count.
|
|
35
|
+
function elementCountScript(_selector) {
|
|
36
|
+
// eslint-disable-next-line
|
|
37
|
+
return document.querySelectorAll(_selector).length
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// The command to be executed by the assertion runner, to find the actual
|
|
41
|
+
// result. Nightwatch API is available as `this.api`.
|
|
42
|
+
this.command = function (callback) {
|
|
43
|
+
this.api.execute(elementCountScript, [selector], callback)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom Nightwatch assertion. The assertion name is the filename.
|
|
3
|
+
*
|
|
4
|
+
* Example usage:
|
|
5
|
+
* browser.assert.elementHasCount(selector, count)
|
|
6
|
+
*
|
|
7
|
+
* For more information on custom assertions see:
|
|
8
|
+
* https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-assertions.html
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
exports.assertion = function elementHasCount(selector: string, count: number) {
|
|
13
|
+
// Message to be displayed on the console while running this assertion.
|
|
14
|
+
this.message = `Testing if element <${selector}> has count: ${count}`
|
|
15
|
+
|
|
16
|
+
// Expected value of the assertion, to be displayed in case of failure.
|
|
17
|
+
this.expected = count
|
|
18
|
+
|
|
19
|
+
// Given the result value (from `this.value` below), this function will
|
|
20
|
+
// evaluate if the assertion has passed.
|
|
21
|
+
this.evaluate = function (value: any) {
|
|
22
|
+
return value === count
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Retrieve the value from the result object we got after running the
|
|
26
|
+
// assertion command (defined below), which is to be evaluated against
|
|
27
|
+
// the value passed into the assertion as the second argument.
|
|
28
|
+
this.value = function (result: Record<string, any>) {
|
|
29
|
+
return result.value
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Script to be executed in the browser to find the actual element count.
|
|
33
|
+
function elementCountScript(_selector: string) {
|
|
34
|
+
// eslint-disable-next-line
|
|
35
|
+
return document.querySelectorAll(_selector).length
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// The command to be executed by the assertion runner, to find the actual
|
|
39
|
+
// result. Nightwatch API is available as `this.api`.
|
|
40
|
+
this.command = function (callback: () => void) {
|
|
41
|
+
this.api.execute(elementCountScript, [selector], callback)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A non-class-based custom-command in Nightwatch. The command name is the filename.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* browser.strictClick(selector)
|
|
6
|
+
*
|
|
7
|
+
* This command is not used yet used in any of the examples.
|
|
8
|
+
*
|
|
9
|
+
* For more information on working with custom-commands see:
|
|
10
|
+
* https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-commands.html
|
|
11
|
+
*
|
|
12
|
+
* @param {string} selector
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
command: function (selector) {
|
|
17
|
+
return this.waitForElementVisible(selector).click(selector)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A non-class-based custom-command in Nightwatch. The command name is the filename.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* browser.strictClick(selector)
|
|
6
|
+
*
|
|
7
|
+
* This command is not used yet used in any of the examples.
|
|
8
|
+
*
|
|
9
|
+
* For more information on working with custom-commands see:
|
|
10
|
+
* https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-commands.html
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
command: function (selector: string) {
|
|
16
|
+
return this.waitForElementVisible(selector).click(selector)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const waitOn = require('wait-on')
|
|
2
|
+
const { setup, teardown } = require('@nightwatch/vue')
|
|
3
|
+
|
|
4
|
+
const serverPort = process.env.CI ? '4173' : '5173'
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
before(done) {
|
|
8
|
+
setup()
|
|
9
|
+
waitOn({
|
|
10
|
+
resources: [`http-get://localhost:${serverPort}`],
|
|
11
|
+
verbose: true,
|
|
12
|
+
headers: {
|
|
13
|
+
accept: 'text/html'
|
|
14
|
+
}
|
|
15
|
+
}).then(() => {
|
|
16
|
+
done()
|
|
17
|
+
})
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
after() {
|
|
21
|
+
teardown()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NightwatchCustomAssertions, NightwatchCustomCommands } from 'nightwatch'
|
|
2
|
+
|
|
3
|
+
declare module 'nightwatch' {
|
|
4
|
+
interface NightwatchCustomAssertions {
|
|
5
|
+
elementHasCount: (selector: string, count: number) => NightwatchBrowser
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface NightwatchCustomCommands {
|
|
9
|
+
strictClick: (selector: string) => NightwatchBrowser
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Refer to the online docs for more details:
|
|
3
|
+
// https://nightwatchjs.org/guide/configuration/nightwatch-configuration-file.html
|
|
4
|
+
//
|
|
5
|
+
// _ _ _ _ _ _ _
|
|
6
|
+
// | \ | |(_) | | | | | | | |
|
|
7
|
+
// | \| | _ __ _ | |__ | |_ __ __ __ _ | |_ ___ | |__
|
|
8
|
+
// | . ` || | / _` || '_ \ | __|\ \ /\ / / / _` || __| / __|| '_ \
|
|
9
|
+
// | |\ || || (_| || | | || |_ \ V V / | (_| || |_ | (__ | | | |
|
|
10
|
+
// \_| \_/|_| \__, ||_| |_| \__| \_/\_/ \__,_| \__| \___||_| |_|
|
|
11
|
+
// __/ |
|
|
12
|
+
// |___/
|
|
13
|
+
//
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
// An array of folders (excluding subfolders) where your tests are located;
|
|
17
|
+
// if this is not specified, the test source must be passed as the second argument to the test runner.
|
|
18
|
+
src_folders: [],
|
|
19
|
+
|
|
20
|
+
// See https://nightwatchjs.org/guide/concepts/page-object-model.html
|
|
21
|
+
page_objects_path: [],
|
|
22
|
+
|
|
23
|
+
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-commands.html
|
|
24
|
+
custom_commands_path: ['nightwatch/custom-commands'],
|
|
25
|
+
|
|
26
|
+
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-assertions.html
|
|
27
|
+
custom_assertions_path: ['nightwatch/custom-assertions'],
|
|
28
|
+
|
|
29
|
+
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-plugins.html
|
|
30
|
+
plugins: ['@nightwatch/vue'],
|
|
31
|
+
|
|
32
|
+
// See https://nightwatchjs.org/guide/concepts/test-globals.html#external-test-globals
|
|
33
|
+
globals_path: 'nightwatch/globals.js',
|
|
34
|
+
|
|
35
|
+
vite_dev_server: {
|
|
36
|
+
start_vite: false
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
webdriver: {},
|
|
40
|
+
|
|
41
|
+
test_workers: {
|
|
42
|
+
enabled: true,
|
|
43
|
+
workers: 'auto'
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
test_settings: {
|
|
47
|
+
default: {
|
|
48
|
+
disable_error_log: false,
|
|
49
|
+
launch_url: `http://localhost:${process.env.CI ? '4173' : '5173'}`,
|
|
50
|
+
|
|
51
|
+
screenshots: {
|
|
52
|
+
enabled: false,
|
|
53
|
+
path: 'screens',
|
|
54
|
+
on_failure: true
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
desiredCapabilities: {
|
|
58
|
+
browserName: 'firefox'
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
webdriver: {
|
|
62
|
+
start_process: true,
|
|
63
|
+
server_path: ''
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
safari: {
|
|
68
|
+
desiredCapabilities: {
|
|
69
|
+
browserName: 'safari',
|
|
70
|
+
alwaysMatch: {
|
|
71
|
+
acceptInsecureCerts: false
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
webdriver: {
|
|
75
|
+
start_process: true,
|
|
76
|
+
server_path: ''
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
firefox: {
|
|
81
|
+
desiredCapabilities: {
|
|
82
|
+
browserName: 'firefox',
|
|
83
|
+
alwaysMatch: {
|
|
84
|
+
acceptInsecureCerts: true,
|
|
85
|
+
'moz:firefoxOptions': {
|
|
86
|
+
args: [
|
|
87
|
+
// '-headless',
|
|
88
|
+
// '-verbose'
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
webdriver: {
|
|
94
|
+
start_process: true,
|
|
95
|
+
server_path: '',
|
|
96
|
+
cli_args: [
|
|
97
|
+
// very verbose geckodriver logs
|
|
98
|
+
// '-vv'
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
chrome: {
|
|
104
|
+
desiredCapabilities: {
|
|
105
|
+
browserName: 'chrome',
|
|
106
|
+
'goog:chromeOptions': {
|
|
107
|
+
// More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
|
|
108
|
+
//
|
|
109
|
+
// w3c:false tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
|
|
110
|
+
w3c: true,
|
|
111
|
+
args: [
|
|
112
|
+
//'--no-sandbox',
|
|
113
|
+
//'--ignore-certificate-errors',
|
|
114
|
+
//'--allow-insecure-localhost',
|
|
115
|
+
//'--headless'
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
webdriver: {
|
|
121
|
+
start_process: true,
|
|
122
|
+
server_path: '',
|
|
123
|
+
cli_args: [
|
|
124
|
+
// --verbose
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
edge: {
|
|
130
|
+
desiredCapabilities: {
|
|
131
|
+
browserName: 'MicrosoftEdge',
|
|
132
|
+
'ms:edgeOptions': {
|
|
133
|
+
w3c: true,
|
|
134
|
+
// More info on EdgeDriver: https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/capabilities-edge-options
|
|
135
|
+
args: [
|
|
136
|
+
//'--headless'
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
webdriver: {
|
|
142
|
+
start_process: true,
|
|
143
|
+
// Download msedgedriver from https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/
|
|
144
|
+
// and set the location below:
|
|
145
|
+
server_path: '',
|
|
146
|
+
cli_args: [
|
|
147
|
+
// --verbose
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/browserslist@4.21.3/node_modules/browserslist/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/browserslist@4.21.3/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/browserslist@4.21.3/node_modules/browserslist/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/browserslist@4.21.3/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/browserslist@4.21.3/node_modules/browserslist/cli.js" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/browserslist@4.21.3/node_modules/browserslist/cli.js" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/chromedriver@114.0.2/node_modules/chromedriver/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/chromedriver@114.0.2/node_modules/chromedriver/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/chromedriver@114.0.2/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/chromedriver@114.0.2/node_modules/chromedriver/bin/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/chromedriver@114.0.2/node_modules/chromedriver/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/chromedriver@114.0.2/node_modules:/Users/haoqun/Developer/vuejs/create-vue/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/chromedriver@114.0.2/node_modules/chromedriver/bin/chromedriver" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../../node_modules/.pnpm/chromedriver@114.0.2/node_modules/chromedriver/bin/chromedriver" "$@"
|
|
17
|
+
fi
|