Skip to content

Commit 8e09b01

Browse files
committed
tests: update examples
1 parent 3ce05a7 commit 8e09b01

File tree

15 files changed

+99
-342
lines changed

15 files changed

+99
-342
lines changed

cypress.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"pluginsFile": "tests/e2e/plugins/index.js"
3+
}

jest.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
preset: "@vue/cli-plugin-unit-jest",
2+
preset: '@vue/cli-plugin-unit-jest',
33
transform: {
4-
"^.+\\.vue$": "vue-jest",
4+
'^.+\\.vue$': 'vue-jest',
55
},
6-
};
6+
}

tests/e2e/.eslintrc.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
module.exports = {
2+
plugins: ['cypress'],
3+
env: {
4+
mocha: true,
5+
'cypress/globals': true,
6+
},
27
rules: {
3-
"no-unused-expressions": "off",
8+
strict: 'off',
49
},
5-
};
10+
}

tests/e2e/custom-assertions/elementCount.js

-34
This file was deleted.

tests/e2e/custom-commands/customExecute.js

-39
This file was deleted.

tests/e2e/custom-commands/openHomepage.js

-23
This file was deleted.

tests/e2e/custom-commands/openHomepageClass.js

-24
This file was deleted.

tests/e2e/globals.js

-103
This file was deleted.

tests/e2e/page-objects/homepage.js

-52
This file was deleted.

tests/e2e/plugins/index.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* eslint-disable arrow-body-style */
2+
// https://docs.cypress.io/guides/guides/plugins-guide.html
3+
4+
// if you need a custom webpack configuration you can uncomment the following import
5+
// and then use the `file:preprocessor` event
6+
// as explained in the cypress docs
7+
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
8+
9+
// /* eslint-disable import/no-extraneous-dependencies, global-require */
10+
// const webpack = require('@cypress/webpack-preprocessor')
11+
12+
module.exports = (on, config) => {
13+
// on('file:preprocessor', webpack({
14+
// webpackOptions: require('@vue/cli-service/webpack.config'),
15+
// watchOptions: {}
16+
// }))
17+
18+
return Object.assign({}, config, {
19+
fixturesFolder: 'tests/e2e/fixtures',
20+
integrationFolder: 'tests/e2e/specs',
21+
screenshotsFolder: 'tests/e2e/screenshots',
22+
videosFolder: 'tests/e2e/videos',
23+
supportFile: 'tests/e2e/support/index.js',
24+
})
25+
}

tests/e2e/specs/test-with-pageobjects.js

-36
This file was deleted.

tests/e2e/specs/test.js

+7-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
// For authoring Nightwatch tests, see
2-
// https://nightwatchjs.org/guide
1+
// https://docs.cypress.io/api/introduction/api.html
32

4-
module.exports = {
5-
"default e2e tests": (browser) => {
6-
browser
7-
.init()
8-
.waitForElementVisible("#app")
9-
.assert.elementPresent(".hello")
10-
.assert.containsText("h1", "Welcome to Your Vue.js App")
11-
.assert.elementCount("img", 1)
12-
.end();
13-
},
14-
15-
"example e2e test using a custom command": (browser) => {
16-
browser.openHomepage().assert.elementPresent(".hello").end();
17-
},
18-
};
3+
describe('My First Test', () => {
4+
it('Visits the app root url', () => {
5+
cy.visit('/')
6+
cy.contains('h1', 'Welcome to Your Vue.js App')
7+
})
8+
})

0 commit comments

Comments
 (0)