diff --git a/e2e-tests/cypress/e2e/add-connection.cy.js b/e2e-tests/cypress/e2e/add-connection.cy.js index 1e7f72ffb..69fb1b96b 100644 --- a/e2e-tests/cypress/e2e/add-connection.cy.js +++ b/e2e-tests/cypress/e2e/add-connection.cy.js @@ -13,7 +13,7 @@ describe('Add connection', () => { it('adds connection', () => { // cy.get('[data-testid=ConnectionList_buttonNewConnection]').click(); cy.get('[data-testid=ConnectionDriverFields_connectionType]').select('MySQL'); - cy.screenshot('connection'); + cy.themeshot('connection'); cy.get('[data-testid=ConnectionDriverFields_user]').clear().type('root'); cy.get('[data-testid=ConnectionDriverFields_password]').clear().type('Pwd2020Db'); cy.get('[data-testid=ConnectionDriverFields_port]').clear().type('16004'); diff --git a/e2e-tests/cypress/e2e/browse-data.cy.js b/e2e-tests/cypress/e2e/browse-data.cy.js index f269f306d..d45807db0 100644 --- a/e2e-tests/cypress/e2e/browse-data.cy.js +++ b/e2e-tests/cypress/e2e/browse-data.cy.js @@ -36,7 +36,7 @@ describe('Data browser data', () => { cy.contains('Out Of Exile').click({ shiftKey: true }); cy.contains('Change text case').click(); cy.contains('AUDIOSLAVE'); - cy.screenshot('freetable'); + cy.themeshot('freetable'); }); it('Load table data', () => { @@ -94,16 +94,16 @@ describe('Data browser data', () => { cy.contains('PgChinook').click(); cy.contains('customer').click(); cy.contains('Leonie').click(); - cy.screenshot('datagrid'); + cy.themeshot('datagrid'); cy.contains('invoice').click(); cy.contains('invoice_line (invoice_id)').click(); - cy.screenshot('masterdetail'); + cy.themeshot('masterdetail'); cy.contains('9, Place Louis Barthou').click(); cy.contains('Switch to form').click(); cy.contains('Switch to table'); // test that we are in form view - cy.screenshot('formview'); + cy.themeshot('formview'); }); it('SQL Gen', () => { @@ -111,7 +111,7 @@ describe('Data browser data', () => { cy.contains('PgChinook').rightclick(); cy.contains('SQL Generator').click(); cy.contains('Check all').click(); - cy.screenshot('sqlgen'); + cy.themeshot('sqlgen'); }); it('Macros in DB', () => { @@ -126,7 +126,7 @@ describe('Data browser data', () => { cy.testid('DataGrid_itemMacros').click(); cy.contains('Change text case').click(); cy.contains('NIELSEN'); - cy.screenshot('macros'); + cy.themeshot('macros'); }); it('Perspectives', () => { @@ -142,10 +142,10 @@ describe('Data browser data', () => { // check track is loaded cy.contains('Put The Finger On You'); - cy.screenshot('perspective1'); + cy.themeshot('perspective1'); }); - it.only('Query editor', () => { + it('Query editor', () => { cy.contains('MySql-connection').click(); cy.contains('MyChinook').click(); cy.contains('Customer').rightclick(); @@ -155,6 +155,6 @@ describe('Data browser data', () => { cy.get('body').realType('select * from Album where Album.'); // code completion cy.contains('ArtistId'); - cy.screenshot('query'); + cy.themeshot('query'); }); }); diff --git a/e2e-tests/cypress/support/commands.js b/e2e-tests/cypress/support/commands.js index c4b3d0399..14d193ea5 100644 --- a/e2e-tests/cypress/support/commands.js +++ b/e2e-tests/cypress/support/commands.js @@ -27,3 +27,17 @@ Cypress.Commands.add('testid', (testId, options = {}) => { return cy.get(`[data-testid="${testId}"]`, options); }); + +Cypress.Commands.add('themeshot', file => { + cy.window().then(win => { + win.__changeCurrentTheme('theme-dark'); + }); + + cy.screenshot(`${file}-dark`); + + cy.window().then(win => { + win.__changeCurrentTheme('theme-light'); + }); + + cy.screenshot(`${file}-light`); +});