Mostly set up
This commit is contained in:
1 parent
2cf9a5b16f
commit
620b4f3ddb
30 files changed
+17386
-57
No files matched your search
@@ -0,0 +1,25 @@
|
||||
// A custom Nightwatch assertion.
|
||||
// The assertion name is the filename.
|
||||
// Example usage:
|
||||
//
|
||||
// browser.assert.elementCount(selector, count)
|
||||
//
|
||||
// For more information on custom assertions see:
|
||||
// http://nightwatchjs.org/guide#writing-custom-assertions
|
||||
|
||||
exports.assertion = function elementCount (selector, count) {
|
||||
this.message = 'Testing if element "' + selector + '" has count: ' + count;
|
||||
this.expected = count;
|
||||
this.pass = (value) => {
|
||||
return value === count;
|
||||
};
|
||||
this.value = (result) => {
|
||||
return result.value;
|
||||
};
|
||||
function evaluator (_selector) {
|
||||
return document.querySelectorAll(_selector).length;
|
||||
}
|
||||
this.command = (cb) => {
|
||||
return this.api.execute(evaluator, [selector], cb);
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// For authoring Nightwatch tests, see
|
||||
// http://nightwatchjs.org/guide#usage
|
||||
|
||||
module.exports = {
|
||||
'default e2e tests': (browser) => {
|
||||
browser
|
||||
.url(process.env.VUE_DEV_SERVER_URL)
|
||||
.waitForElementVisible('#app', 5000)
|
||||
.assert.elementPresent('.hello')
|
||||
.assert.containsText('h1', 'Welcome to your Vue.js Desktop App in NW.js!')
|
||||
.assert.containsText('[data-test="versions]"', 'You are using Vue.js (v2.6.10), NW.js (v0.39.2-sdk), Node.js (v12.4.0), and Chromium (v75.0.3770.100).')
|
||||
.assert.elementCount('img', 2)
|
||||
.end();
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
jest: true
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
import HelloWorld from '@/components/HelloWorld.vue';
|
||||
|
||||
describe('HelloWorld.vue', () => {
|
||||
it('renders props.msg when passed', () => {
|
||||
const msg = 'new message';
|
||||
const wrapper = shallowMount(HelloWorld, {
|
||||
propsData: { msg }
|
||||
});
|
||||
expect(wrapper.text()).toMatch(msg);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user