Merge pull request #37 from vegaprotocol/test/Cypress-BDD-integration
Test/cypress bdd integration
This commit is contained in:
commit
6ae06b1a0d
3
.env
3
.env
@ -1 +1,4 @@
|
||||
NX_CHAIN_EXPLORER_URL = "https://explorer.vega.trading/.netlify/functions/chain-explorer-api"
|
||||
NX_TENDERMINT_URL = "https://lb.testnet.vega.xyz/tm"
|
||||
NX_TENDERMINT_WEBSOCKET_URL = "wss://lb.testnet.vega.xyz/tm/websocket"
|
||||
NX_VEGA_URL = "https://lb.testnet.vega.xyz/query"
|
||||
|
3
apps/explorer-e2e/.cypress-cucumber-preprocessorrc
Normal file
3
apps/explorer-e2e/.cypress-cucumber-preprocessorrc
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"stepDefinitions": "src/support/step_definitions"
|
||||
}
|
@ -1,12 +1,18 @@
|
||||
{
|
||||
"baseUrl": "http://localhost:4200",
|
||||
"fileServerFolder": ".",
|
||||
"fixturesFolder": "./src/fixtures",
|
||||
"fixturesFolder": false,
|
||||
"pluginsFile": "./src/plugins/index.js",
|
||||
"testFiles": "*.{ts,feature,features}",
|
||||
"ignoreTestFiles": "**/*.js",
|
||||
"integrationFolder": "./src/integration",
|
||||
"modifyObstructiveCode": false,
|
||||
"supportFile": "./src/support/index.ts",
|
||||
"pluginsFile": false,
|
||||
"video": true,
|
||||
"videosFolder": "../../dist/cypress/apps/explorer-e2e/videos",
|
||||
"screenshotsFolder": "../../dist/cypress/apps/explorer-e2e/screenshots",
|
||||
"chromeWebSecurity": false
|
||||
"chromeWebSecurity": false,
|
||||
"env": {
|
||||
"tsConfig": "tsconfig.json"
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
import { getGreeting } from '../support/app.po';
|
||||
|
||||
describe('explorer', () => {
|
||||
beforeEach(() => cy.visit('/'));
|
||||
|
||||
it('should display welcome message', () => {
|
||||
// Custom command example, see `../support/commands.ts` file
|
||||
cy.login('my-email@something.com', 'myPassword');
|
||||
|
||||
// Function helper example, see `../support/app.po.ts` file
|
||||
getGreeting().contains('Welcome explorer');
|
||||
});
|
||||
});
|
4
apps/explorer-e2e/src/integration/home-page.feature
Normal file
4
apps/explorer-e2e/src/integration/home-page.feature
Normal file
@ -0,0 +1,4 @@
|
||||
Feature: Home page
|
||||
|
||||
Scenario: Visit Home page
|
||||
Given I go to the homepage
|
75
apps/explorer-e2e/src/plugins/index.js
Normal file
75
apps/explorer-e2e/src/plugins/index.js
Normal file
@ -0,0 +1,75 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
const webpackPreprocessor = require('@cypress/webpack-preprocessor');
|
||||
const webpack = require('webpack');
|
||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
const nodeExternals = require('webpack-node-externals');
|
||||
|
||||
/**
|
||||
* @type {Cypress.PluginConfig}
|
||||
*/
|
||||
module.exports = (on, config) => {
|
||||
on(
|
||||
'file:preprocessor',
|
||||
webpackPreprocessor({
|
||||
webpackOptions: {
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
|
||||
plugins: [
|
||||
new TsconfigPathsPlugin({
|
||||
configFile: config.env.tsConfig,
|
||||
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
|
||||
}),
|
||||
],
|
||||
fallback: {
|
||||
path: require.resolve('path-browserify'),
|
||||
},
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.([jt])sx?$/,
|
||||
loader: 'ts-loader',
|
||||
exclude: [/node_modules/],
|
||||
options: {
|
||||
configFile: config.env.tsConfig,
|
||||
// https://github.com/TypeStrong/ts-loader/pull/685
|
||||
experimentalWatchApi: true,
|
||||
transpileOnly: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.feature$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'cypress-cucumber-preprocessor/loader',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.features$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'cypress-cucumber-preprocessor/lib/featuresLoader',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new ForkTsCheckerWebpackPlugin({
|
||||
typescript: {
|
||||
enabled: true,
|
||||
configFile: config.env.tsConfig,
|
||||
},
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
process: 'process/browser',
|
||||
}),
|
||||
],
|
||||
externals: [nodeExternals()],
|
||||
},
|
||||
})
|
||||
);
|
||||
};
|
@ -0,0 +1,5 @@
|
||||
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps';
|
||||
|
||||
Given('I go to the homepage', () => {
|
||||
cy.visit('/');
|
||||
});
|
97505
package-lock.json
generated
97505
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -65,7 +65,8 @@
|
||||
"@typescript-eslint/parser": "~5.10.0",
|
||||
"babel-jest": "27.2.3",
|
||||
"babel-loader": "8.1.0",
|
||||
"cypress": "^9.1.0",
|
||||
"cypress": "^9.5.1",
|
||||
"cypress-cucumber-preprocessor": "^4.3.1",
|
||||
"eslint": "~8.7.0",
|
||||
"eslint-config-next": "12.0.7",
|
||||
"eslint-config-prettier": "8.1.0",
|
||||
|
Loading…
Reference in New Issue
Block a user