Skip to content

Commit

Permalink
NYS-84: minor changes to see if we can address performance issues wit…
Browse files Browse the repository at this point in the history
…h the GH Action
  • Loading branch information
joelsteidl committed Feb 19, 2024
1 parent ebbf05b commit 632e6c6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
24 changes: 7 additions & 17 deletions tests/cypress/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
const { defineConfig } = require("cypress");

const { defineConfig } = require('cypress')
module.exports = defineConfig({
video: false,
viewportWidth: 1280,
viewportHeight: 720,
e2e: {
baseUrl: 'https://nysenate.ddev.site',
// Allows for use of cy.task('log', 'This will be output to the terminal')
// for console logging and debugging.
setupNodeEvents(on, config) {
on('task', {
log(message) {
console.log(message)

return null
},
})
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'https://nysenate.ddev.site'
},
env: {
'drushCommand': 'ddev drush'
},
video: false
});
})
20 changes: 7 additions & 13 deletions tests/cypress/cypress/e2e/visual-regression.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ Cypress.on('uncaught:exception', (err, runnable) => {
})

describe('Bulk Visual Regression testing with Percy', () => {
Cypress._.each(vrtUrls, (data) => {
vrtUrls.forEach((data) => {
it(`Sending ${data.name} (${data.path}) to Percy`, function () {
cy.request({
url: data.path,
retryOnStatusCodeFailure: true,
retries: 3
}).then(() => {
cy.visit(data.path);
cy.scrollTo('bottom');
cy.percySnapshot(data.name);
});
});
});
});
cy.visit(data.path)
cy.scrollTo('bottom')
cy.percySnapshot(data.name)
})
})
})
17 changes: 17 additions & 0 deletions tests/cypress/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};

0 comments on commit 632e6c6

Please sign in to comment.