mirror of
https://github.com/SomboChea/ui
synced 2024-12-25 05:34:26 +07:00
Merge pull request #44 from DanielRuf/test/bdd-acceptance-testing-setup
test: BDD / acceptance tests
This commit is contained in:
commit
e1d8eafb7a
22
codecept.conf.js
Normal file
22
codecept.conf.js
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
exports.config = {
|
||||
tests: './test/acceptance/*_test.js',
|
||||
output: './test/acceptance/output',
|
||||
helpers: {
|
||||
Puppeteer: {
|
||||
url: 'http://localhost:8080',
|
||||
// "show": true,
|
||||
chrome: {
|
||||
// headless: false
|
||||
}
|
||||
}
|
||||
},
|
||||
include: {
|
||||
I: './test/acceptance/steps_file.js'
|
||||
},
|
||||
smartWait: 30000,
|
||||
bootstrap: null,
|
||||
plugins: {},
|
||||
mocha: {},
|
||||
name: '@verdaccio/ui-theme'
|
||||
}
|
@ -28,9 +28,10 @@
|
||||
"@verdaccio/eslint-config": "2.0.0",
|
||||
"@verdaccio/types": "7.0.0",
|
||||
"autosuggest-highlight": "3.1.1",
|
||||
"babel-loader": "8.0.6",
|
||||
"bundlesize": "0.18.0",
|
||||
"codeceptjs": "2.1.0",
|
||||
"codecov": "3.5.0",
|
||||
"babel-loader": "8.0.6",
|
||||
"concurrently": "4.1.0",
|
||||
"cross-env": "5.2.0",
|
||||
"css-loader": "0.28.10",
|
||||
@ -136,7 +137,10 @@
|
||||
"type-check": "tsc --noEmit",
|
||||
"type-check:watch": "npm run type-check -- --watch",
|
||||
"release": "standard-version -a -s",
|
||||
"test": "cross-env NODE_ENV=test BABEL_ENV=test TZ=UTC jest --config ./jest/jest.config.js --maxWorkers 2",
|
||||
"test:clean": "npx jest --clearCache",
|
||||
"test:acceptance": "codeceptjs run --steps",
|
||||
"test:acceptance:server": "concurrently --kill-others \"npm run verdaccio:server\" \"npm run test:acceptance\"",
|
||||
"test": "cross-env NODE_ENV=test BABEL_ENV=test TZ=UTC jest --config ./jest/jest.config.js --maxWorkers 2 --passWithNoTests",
|
||||
"test:size": "bundlesize",
|
||||
"lint": "npm run lint:js && npm run lint:css",
|
||||
"lint:js": "npm run type-check && eslint . --ext .js,.ts,.tsx",
|
||||
|
1
test/acceptance/.gitignore
vendored
Normal file
1
test/acceptance/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
output
|
9
test/acceptance/Menu_test.js
Normal file
9
test/acceptance/Menu_test.js
Normal file
@ -0,0 +1,9 @@
|
||||
Feature('Menu');
|
||||
|
||||
Scenario('check if we find the npm commands to set the registry', (I) => {
|
||||
I.amOnPage('http://localhost:8080');
|
||||
I.waitForElement('#header--button-registryInfo', 5);
|
||||
I.click('#header--button-registryInfo');
|
||||
I.waitForElement('#registryInfo--dialog-container');
|
||||
I.see('npm set registry http://localhost:8080');
|
||||
});
|
10
test/acceptance/SearchResult_test.js
Normal file
10
test/acceptance/SearchResult_test.js
Normal file
@ -0,0 +1,10 @@
|
||||
Feature('SearchResult');
|
||||
|
||||
Scenario('check if we get the "no results found" text', (I) => {
|
||||
I.amOnPage('http://localhost:8080');
|
||||
I.seeElement('header .react-autosuggest__input input');
|
||||
I.fillField('header .react-autosuggest__input input', 'test');
|
||||
I.waitForElement('header .react-autosuggest__suggestions-container');
|
||||
I.wait(1);
|
||||
I.see('No results found.', 'header .react-autosuggest__suggestions-container');
|
||||
});
|
11
test/acceptance/steps_file.js
Normal file
11
test/acceptance/steps_file.js
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
// in this file you can append custom step methods to 'I' object
|
||||
|
||||
module.exports = function() {
|
||||
return actor({
|
||||
|
||||
// Define custom steps here, use 'this' to access default methods of I.
|
||||
// It is recommended to place a general 'login' function here.
|
||||
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user