1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

chore(lint): fixed lint issues in cypress folder

This commit is contained in:
Yury Shkoda
2022-05-12 09:06:52 +03:00
parent dd237ceeec
commit 54a33ac98a
5 changed files with 111 additions and 90 deletions

View File

@@ -3,7 +3,7 @@ const username = Cypress.env('username')
const password = Cypress.env('password')
const testingFinishTimeout = Cypress.env('testingFinishTimeout')
context('sasjs-tests', function() {
context('sasjs-tests', function () {
this.beforeAll(() => {
cy.visit(sasjsTestsUrl)
})
@@ -13,17 +13,27 @@ context('sasjs-tests', function() {
})
it('Should have all tests successfull', (done) => {
cy.get('body').then($body => {
cy.get('body').then(($body) => {
if ($body.find('input[placeholder="User Name"]').length > 0) {
cy.get('input[placeholder="User Name"]').type(username)
cy.get('input[placeholder="Password"]').type(password)
cy.get('.submit-button').click()
}
cy.get('input[placeholder="User Name"]', {timeout: 40000}).should('not.exist').then(() => {
cy.get('.ui.massive.icon.primary.left.labeled.button').click().then(() => {
cy.get('.ui.massive.loading.primary.button', {timeout: testingFinishTimeout}).should('not.exist').then(() => {
cy.get('span.icon.failed').should('not.exist').then(() => {
cy.get('input[placeholder="User Name"]', { timeout: 40000 })
.should('not.exist')
.then(() => {
cy.get('.ui.massive.icon.primary.left.labeled.button')
.click()
.then(() => {
cy.get('.ui.massive.loading.primary.button', {
timeout: testingFinishTimeout
})
.should('not.exist')
.then(() => {
cy.get('span.icon.failed')
.should('not.exist')
.then(() => {
done()
})
})
@@ -33,25 +43,36 @@ context('sasjs-tests', function() {
})
it('Should have all tests successfull with debug on', (done) => {
cy.get('body').then($body => {
cy.get('body').then(($body) => {
if ($body.find('input[placeholder="User Name"]').length > 0) {
cy.get('input[placeholder="User Name"]').type(username)
cy.get('input[placeholder="Password"]').type(password)
cy.get('.submit-button').click()
}
cy.get('.ui.fitted.toggle.checkbox label').click().then(() => {
cy.get('input[placeholder="User Name"]', {timeout: 40000}).should('not.exist').then(() => {
cy.get('.ui.massive.icon.primary.left.labeled.button').click().then(() => {
cy.get('.ui.massive.loading.primary.button', {timeout: testingFinishTimeout}).should('not.exist').then(() => {
cy.get('span.icon.failed').should('not.exist').then(() => {
cy.get('.ui.fitted.toggle.checkbox label')
.click()
.then(() => {
cy.get('input[placeholder="User Name"]', { timeout: 40000 })
.should('not.exist')
.then(() => {
cy.get('.ui.massive.icon.primary.left.labeled.button')
.click()
.then(() => {
cy.get('.ui.massive.loading.primary.button', {
timeout: testingFinishTimeout
})
.should('not.exist')
.then(() => {
cy.get('span.icon.failed')
.should('not.exist')
.then(() => {
done()
})
})
})
})
})
})
})
})

View File

@@ -9,7 +9,7 @@ const webpackOptions = {
{
test: /\.ts$/,
loaders: ['ts-loader'],
exclude: [/node_modules/],
exclude: [/node_modules/]
},
{
test: /\.(html|css)$/,

View File

@@ -12,7 +12,7 @@
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
const wp = require("@cypress/webpack-preprocessor");
const wp = require('@cypress/webpack-preprocessor')
/**
* @type {Cypress.PluginConfig}
@@ -22,21 +22,21 @@ module.exports = (on, config) => {
// `config` is the resolved Cypress config
const options = {
webpackOptions: require("../webpack.config.js")
};
on("file:preprocessor", wp(options));
on("before:browser:launch", (browser = {}, launchOptions) => {
if (browser.name === "chrome") {
launchOptions.args.push("--disable-site-isolation-trials");
launchOptions.args.push("--auto-open-devtools-for-tabs");
launchOptions.args.push("--aggressive-cache-discard")
launchOptions.args.push("--disable-cache")
launchOptions.args.push("--disable-application-cache")
launchOptions.args.push("--disable-offline-load-stale-cache")
launchOptions.args.push("--disk-cache-size=0")
return launchOptions;
webpackOptions: require('../webpack.config.js')
}
});
on('file:preprocessor', wp(options))
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name === 'chrome') {
launchOptions.args.push('--disable-site-isolation-trials')
launchOptions.args.push('--auto-open-devtools-for-tabs')
launchOptions.args.push('--aggressive-cache-discard')
launchOptions.args.push('--disable-cache')
launchOptions.args.push('--disable-application-cache')
launchOptions.args.push('--disable-offline-load-stale-cache')
launchOptions.args.push('--disk-cache-size=0')
return launchOptions
}
})
}

View File

@@ -7,4 +7,4 @@
"types": ["cypress"]
},
"include": ["**/*.ts"]
}
}

View File

@@ -1,7 +1,7 @@
module.exports = {
mode: "development",
mode: 'development',
resolve: {
extensions: [".ts", ".js"]
extensions: ['.ts', '.js']
},
module: {
rules: [
@@ -10,7 +10,7 @@ module.exports = {
exclude: [/node_modules/],
use: [
{
loader: "ts-loader",
loader: 'ts-loader',
options: {
// skip typechecking for speed
transpileOnly: true
@@ -20,4 +20,4 @@ module.exports = {
}
]
}
};
}