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

[#1931] Update frontend integration tests for summary and zoom view #2015

Merged
merged 16 commits into from
Aug 31, 2023
257 changes: 257 additions & 0 deletions frontend/cypress/tests/chartView/chartView_zoomFeature.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,260 @@ describe('zoom features in code view', () => {
.should('be.visible');
});
});

describe('date changes in chart view should reflect in zoom', () => {
it('changing \'since\' date range changes the zoom view', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('eugene');

cy.get('input[name="since"]:visible')
.type('2018-06-11');

cy.get('.icon-button.fa-list-ul')
.should('be.visible')
.first()
.click();

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.last()
.invoke('attr', 'title')
.should('eq', '[2018-06-12] Setup AppVeyor CI (#142): +19 -0 lines ');
germainelee02 marked this conversation as resolved.
Show resolved Hide resolved
});

it('changing \'since\' date again will result in a different zoom view', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('yong hao');

cy.get('input[name="since"]:visible')
.type('2018-05-20');

cy.get('.icon-button.fa-list-ul')
.should('be.visible')
.first()
.click();

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.last()
.invoke('attr', 'title')
.should('eq', '[2018-05-20] Apply single responsibility principle to frontend component (#99): +201 -90 lines ');
});

it('changing the \'until\' date will results in a different zoom view', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('eugene');

cy.get('input[name="until"]:visible')
.type('2019-08-19');

cy.get('.icon-button.fa-list-ul')
.should('be.visible')
.first()
.click();

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.first()
.invoke('attr', 'title')
.should('eq', '[2019-08-18] AboutUs: update team members (#867): +94 -12 lines ');
});

it('changing the \'until\' date again will result in a different zoom view', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('metta');

cy.get('input[name="until"]:visible')
.type('2018-07-20');

cy.get('.icon-button.fa-list-ul')
.should('be.visible')
.first()
.click();

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.first()
.invoke('attr', 'title')
.should('eq', '[2018-07-20] Dashboard: remove navigation bar (#171): +5 -1 lines ');
});

it('changing the \'until\' and \'since\' date again will result in a different zoom view', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('eugene');

cy.get('input[name="since"]:visible')
.type('2018-08-27');

cy.get('input[name="until"]:visible')
.type('2019-03-09');

cy.get('.icon-button.fa-list-ul')
.should('be.visible')
.first()
.click();

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.first()
.invoke('attr', 'title')
.should('eq', '[2019-03-08] [#587] Fix unoriented output messages (#593): +105 -69 lines ');

cy.get('#tab-zoom .ramp .ramp__slice')
.last()
.invoke('attr', 'title')
.should('eq', '[2018-08-27] [#311] code view: differentiate untouched code more (#314): +12 -5 lines ');
});

it('changing the \'until\' and \'since\' date again will result in a different zoom view', () => {
germainelee02 marked this conversation as resolved.
Show resolved Hide resolved
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('james');

cy.get('input[name="since"]:visible')
.type('2019-07-22');

cy.get('input[name="until"]:visible')
.type('2019-08-01');

cy.get('.icon-button.fa-list-ul')
.should('be.visible')
.first()
.click();

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.first()
.invoke('attr', 'title')
.should('eq', '[2019-08-01] Zoom Tab: revamp header ui (#848): +53 -30 lines ');

cy.get('#tab-zoom .ramp .ramp__slice')
.last()
.invoke('attr', 'title')
.should(
'eq',
'[2019-07-24] [#828] Revert "v_summary.js: remove redundant '
+ 'calls to getFiltered() (#800)" (#832): +0 -9 lines ',
);
});
});

describe('range changes in chartview should reflect in zoom', () => {
const zoomKey = Cypress.platform === 'darwin' ? '{meta}' : '{ctrl}';

it('selecting the righthand and lefthand boundary', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('james');
cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
.click(120, 20)
.click(250, 20);

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.first()
.invoke('attr', 'title')
.should('eq', '[2021-01-04] Update `About us` page (#1393): +55 -30 lines ');
cy.get('#tab-zoom .ramp .ramp__slice')
.last()
.invoke('attr', 'title')
.should('eq', '[2019-12-20] [#46] Show total time after batch processing (#758): +43 -0 lines ');
});

it('changing the righthand boundary', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('james');
cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
.click(120, 20)
.click(200, 20);

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.first()
.invoke('attr', 'title')
.should('eq', '[2020-10-01] [#1312] Conditional run for markbind to gh pages deployment (#1337): +1 -0 lines ');
cy.get('#tab-zoom .ramp .ramp__slice')
.last()
.invoke('attr', 'title')
.should('eq', '[2019-12-20] [#46] Show total time after batch processing (#758): +43 -0 lines ');
});

it('changing the lefthand boundary', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('james');
cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
.click(200, 20)
.click(250, 20);

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.first()
.invoke('attr', 'title')
.should('eq', '[2021-01-04] Update `About us` page (#1393): +55 -30 lines ');
cy.get('#tab-zoom .ramp .ramp__slice')
.last()
.invoke('attr', 'title')
.should('eq', '[2020-11-21] [#1345] Authorship: Add last modified '
+ 'date to each LoC if specified (#1348): +165 -76 lines ');
});

it('changing the righthand and lefthand boundary', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('james');

cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
.click(200, 20)
.click(225, 20);

cy.get('#tab-zoom')
.should('be.visible');

cy.get('#tab-zoom .ramp .ramp__slice')
.first()
.invoke('attr', 'title')
.should(
'eq',
'[2021-01-04] Update `About us` page (#1393): +55 -30 lines ',
);

cy.get('#tab-zoom .ramp .ramp__slice')
.last()
.invoke('attr', 'title')
.should('eq', '[2020-11-21] [#1345] Authorship: Add last modified date '
+ 'to each LoC if specified (#1348): +165 -76 lines ');
});
});
Loading