screenshot=>themeshot

This commit is contained in:
SPRINX0\prochazka
2025-01-29 15:40:41 +01:00
parent bee7ec0cc7
commit f22adf3cc8
3 changed files with 24 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ describe('Add connection', () => {
it('adds connection', () => { it('adds connection', () => {
// cy.get('[data-testid=ConnectionList_buttonNewConnection]').click(); // cy.get('[data-testid=ConnectionList_buttonNewConnection]').click();
cy.get('[data-testid=ConnectionDriverFields_connectionType]').select('MySQL'); 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_user]').clear().type('root');
cy.get('[data-testid=ConnectionDriverFields_password]').clear().type('Pwd2020Db'); cy.get('[data-testid=ConnectionDriverFields_password]').clear().type('Pwd2020Db');
cy.get('[data-testid=ConnectionDriverFields_port]').clear().type('16004'); cy.get('[data-testid=ConnectionDriverFields_port]').clear().type('16004');

View File

@@ -36,7 +36,7 @@ describe('Data browser data', () => {
cy.contains('Out Of Exile').click({ shiftKey: true }); cy.contains('Out Of Exile').click({ shiftKey: true });
cy.contains('Change text case').click(); cy.contains('Change text case').click();
cy.contains('AUDIOSLAVE'); cy.contains('AUDIOSLAVE');
cy.screenshot('freetable'); cy.themeshot('freetable');
}); });
it('Load table data', () => { it('Load table data', () => {
@@ -94,16 +94,16 @@ describe('Data browser data', () => {
cy.contains('PgChinook').click(); cy.contains('PgChinook').click();
cy.contains('customer').click(); cy.contains('customer').click();
cy.contains('Leonie').click(); cy.contains('Leonie').click();
cy.screenshot('datagrid'); cy.themeshot('datagrid');
cy.contains('invoice').click(); cy.contains('invoice').click();
cy.contains('invoice_line (invoice_id)').click(); cy.contains('invoice_line (invoice_id)').click();
cy.screenshot('masterdetail'); cy.themeshot('masterdetail');
cy.contains('9, Place Louis Barthou').click(); cy.contains('9, Place Louis Barthou').click();
cy.contains('Switch to form').click(); cy.contains('Switch to form').click();
cy.contains('Switch to table'); // test that we are in form view cy.contains('Switch to table'); // test that we are in form view
cy.screenshot('formview'); cy.themeshot('formview');
}); });
it('SQL Gen', () => { it('SQL Gen', () => {
@@ -111,7 +111,7 @@ describe('Data browser data', () => {
cy.contains('PgChinook').rightclick(); cy.contains('PgChinook').rightclick();
cy.contains('SQL Generator').click(); cy.contains('SQL Generator').click();
cy.contains('Check all').click(); cy.contains('Check all').click();
cy.screenshot('sqlgen'); cy.themeshot('sqlgen');
}); });
it('Macros in DB', () => { it('Macros in DB', () => {
@@ -126,7 +126,7 @@ describe('Data browser data', () => {
cy.testid('DataGrid_itemMacros').click(); cy.testid('DataGrid_itemMacros').click();
cy.contains('Change text case').click(); cy.contains('Change text case').click();
cy.contains('NIELSEN'); cy.contains('NIELSEN');
cy.screenshot('macros'); cy.themeshot('macros');
}); });
it('Perspectives', () => { it('Perspectives', () => {
@@ -142,10 +142,10 @@ describe('Data browser data', () => {
// check track is loaded // check track is loaded
cy.contains('Put The Finger On You'); 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('MySql-connection').click();
cy.contains('MyChinook').click(); cy.contains('MyChinook').click();
cy.contains('Customer').rightclick(); cy.contains('Customer').rightclick();
@@ -155,6 +155,6 @@ describe('Data browser data', () => {
cy.get('body').realType('select * from Album where Album.'); cy.get('body').realType('select * from Album where Album.');
// code completion // code completion
cy.contains('ArtistId'); cy.contains('ArtistId');
cy.screenshot('query'); cy.themeshot('query');
}); });
}); });

View File

@@ -27,3 +27,17 @@
Cypress.Commands.add('testid', (testId, options = {}) => { Cypress.Commands.add('testid', (testId, options = {}) => {
return cy.get(`[data-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`);
});