Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMA-145 - Security findings #61

Merged
merged 2 commits into from
Feb 21, 2024
Merged
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
4,372 changes: 0 additions & 4,372 deletions dev/test/package-lock.json

This file was deleted.

22 changes: 22 additions & 0 deletions dev/testv2/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { defineConfig } = require('cypress');

module.exports = defineConfig({
video: false,
trashAssetsBeforeRuns: false,
requestTimeout: 30000,
defaultCommandTimeout: 30000,
pageLoadTimeout: 30000,
blockHosts: ['*snippet.url.com', '*scarabresearch.com'],
env: {
snippetUrl: 'http://snippet.url.com/main.js'
},
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://magento-test.local/index.php/default/',
specPattern: 'cypress/integration/**/*.spec.js'
}
});
12 changes: 0 additions & 12 deletions dev/testv2/cypress.json

This file was deleted.

2 changes: 1 addition & 1 deletion dev/testv2/cypress/integration/default-behaviour.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Default behaviour with everything turned off', function() {
cy.task('setDefaultCustomerProperty', { email: newEmail, password: newPassword });

cy.task('getSentAddresses').then(emailAddresses => {
expect(emailAddresses).to.be.eql([this.defaultCustomer.email]);
expect(emailAddresses).to.include.members([this.defaultCustomer.email]);
});
});
});
Expand Down
8 changes: 4 additions & 4 deletions dev/testv2/cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ db('information_schema.tables')
const { table_name: tableName } = rows[0];
let prefix = tableName.split('core_config_data')[0];
let replaceQuery = db(prefix + 'core_config_data')
.insert({scope: 'default', scope_id: 0, path: 'oauth/consumer/enable_integration_as_bearer', value: '1'})
.insert({ scope: 'default', scope_id: 0, path: 'oauth/consumer/enable_integration_as_bearer', value: '1' })
.toString().replace(/^INSERT/i, 'REPLACE');

db.raw(replaceQuery).then((result) => {
db.raw(replaceQuery).then(() => {
let _baseUrl = process.env.CYPRESS_baseUrl || 'http://magento-test.local';
axios.get(`${_baseUrl}/cache-flush.php`)
})
axios.get(`${_baseUrl}/cache-flush.php`);
});
});
// END API bearer token compatibility

Expand Down
4 changes: 2 additions & 2 deletions dev/testv2/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Cypress.Commands.add('shouldCreateEvent', (type, expectedDataSubset) => {

Cypress.Commands.add('shouldNotExistsEvents', () => {
cy.task('getAllEvents').then(events => {
expect(events.length).to.be.empty;
expect(events.length).to.equal(0);
});
});

Expand Down Expand Up @@ -59,7 +59,7 @@ Cypress.Commands.add('shouldNotShowErrorMessage', excludeErrorMessage => {
expect(errorMessage).to.include(excludeErrorMessage);
});
} else {
return cy.get('[data-ui-id="message-error"]').should('not.be.visible');
return cy.get('[data-ui-id="message-error"]').should('not.exist');
}
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

require('cypress-plugin-retries');
require('./commands');

before(() => {
Expand All @@ -16,6 +15,7 @@ Cypress.on('uncaught:exception', (err, runnable) => { // eslint-disable-line no-
let logs = '';

Cypress.on('window:before:load', window => {
/*
const docIframe = window.parent.document.getElementById("Your App: 'test'");
const appWindow = docIframe.contentWindow;

Expand All @@ -24,6 +24,7 @@ Cypress.on('window:before:load', window => {
logs += args.join(' ') + '\n';
};
});
*/
});

Cypress.mocha.getRunner().on('test', () => {
Expand Down
Loading
Loading