Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/* eslint-disable no-undef */
const { defineConfig } = require('cypress');
const fs = require('fs');
const { resolve } = require('path');
// TODO: Upgrade @cypress/webpack-preprocessor to latest once Webpack is upgraded
const webpackPreprocessor = require('@cypress/webpack-preprocessor');
// TODO: Use webpack-configs from shared.js once Webpack is upgraded
// const webpackConfigOptions = require('./config/webpack/shared.js');

// TODO: Relocate the aliases to webpack-config and reference its options directly from shared.js.
const webpackConfigOptions = {
resolve: {
alias: {
'@cypress-dir': resolve(__dirname, 'cypress'),
},
extensions: ['.js'],
},
};

module.exports = defineConfig({
e2e: {
Expand Down Expand Up @@ -44,6 +59,12 @@ module.exports = defineConfig({
console.log('Actual args:', launchOptions.args);
return launchOptions;
});
on(
'file:preprocessor',
webpackPreprocessor({
webpackOptions: webpackConfigOptions,
})
);
},
},
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
import { flashClassMap } from '../../../../support/assertions/assertion_constants';
import { flashClassMap } from '@cypress-dir/support/assertions/assertion_constants.js';

// Menu options
const SETTINGS_MENU_OPTION = 'Settings';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
import { flashClassMap } from '../../../../support/assertions/assertion_constants';
import { flashClassMap } from '@cypress-dir/support/assertions/assertion_constants.js';

// Component route url
const COMPONENT_ROUTE_URL = '/ops/explorer';
Expand Down Expand Up @@ -206,9 +206,9 @@ describe('Automate Collect logs Edit form operations', () => {

after(() => {
cy.url()
?.then((url) => {
.then((url) => {
// Ensures navigation to Settings -> Application-Settings in the UI
if (!url?.includes(COMPONENT_ROUTE_URL)) {
if (!url.includes(COMPONENT_ROUTE_URL)) {
// Navigate to Settings -> Application-Settings before cleanup
cy.menu(SETTINGS_MENU_OPTION, APP_SETTINGS_MENU_OPTION);
}
Expand Down Expand Up @@ -247,9 +247,9 @@ describe('Automate Collect logs Edit form operations', () => {

after(() => {
cy.url()
?.then((url) => {
.then((url) => {
// Ensures navigation to Settings -> Application-Settings in the UI
if (!url?.includes(COMPONENT_ROUTE_URL)) {
if (!url.includes(COMPONENT_ROUTE_URL)) {
// Navigate to Settings -> Application-Settings before cleanup
cy.menu(SETTINGS_MENU_OPTION, APP_SETTINGS_MENU_OPTION);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
import { flashClassMap } from '../../../../support/assertions/assertion_constants';
import { flashClassMap } from '@cypress-dir/support/assertions/assertion_constants.js';

// Component route url
const COMPONENT_ROUTE_URL = '/ops/explorer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
import { flashClassMap } from '../../../../support/assertions/assertion_constants';
import { flashClassMap } from '@cypress-dir/support/assertions/assertion_constants.js';

describe('Settings > Application Settings > Access Control', () => {
// Navigation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
import { flashClassMap } from '../../../../support/assertions/assertion_constants';
import { flashClassMap } from '@cypress-dir/support/assertions/assertion_constants.js';

// Component route url
const COMPONENT_ROUTE_URL = '/ops/explorer#/';
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/assertions/expect_alerts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
import { flashClassMap } from './assertion_constants';
import { flashClassMap } from '@cypress-dir/support/assertions/assertion_constants.js';

/**
* Custom Cypress command to validate flash messages.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"@babel/preset-react": "~7.9.1",
"@babel/register": "~7.9.0",
"@babel/runtime-corejs3": "~7.9.0",
"@cypress/webpack-preprocessor": "~2.0.1",
"angular-mocks": "~1.6.9",
"autoprefixer": "~9.8.0",
"babel-eslint": "~10.1.0",
Expand Down
Loading