diff --git a/.editorconfig b/.editorconfig index afba95f39..585a73676 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,6 +6,7 @@ root = true # Settings for IETF datatracker # --------------------------------------------------------- +# PEP8 Style [*] indent_style = space @@ -18,6 +19,7 @@ insert_final_newline = false # Settings for .github folder # --------------------------------------------------------- +# GitHub Markdown Style [.github/**] indent_style = space @@ -29,6 +31,7 @@ insert_final_newline = true # Settings for client-side JS / Vue files # --------------------------------------------------------- +# StandardJS Style [client/**] indent_style = space @@ -36,4 +39,16 @@ indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true +insert_final_newline = true + +# Settings for cypress tests +# --------------------------------------------------------- +# StandardJS Style + +[cypress/**] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true insert_final_newline = true \ No newline at end of file diff --git a/cypress/integration/meeting/agenda.spec.js b/cypress/integration/meeting/agenda.spec.js index 6455230a6..1cfe555c9 100644 --- a/cypress/integration/meeting/agenda.spec.js +++ b/cypress/integration/meeting/agenda.spec.js @@ -1,103 +1,103 @@ /// describe('meeting agenda', () => { - before(() => { - cy.visit('/meeting/agenda/') - }) - - it('toggle customize panel when clicking on customize header bar', () => { - cy.get('#agenda-filter-customize').click() - cy.get('#customize').should('be.visible').and('have.class', 'in') + before(() => { + cy.visit('/meeting/agenda/') + }) - cy.get('#agenda-filter-customize').click() - cy.get('#customize').should('not.be.visible').and('not.have.class', 'in') + it('toggle customize panel when clicking on customize header bar', () => { + cy.get('#agenda-filter-customize').click() + cy.get('#customize').should('be.visible').and('have.class', 'in') + + cy.get('#agenda-filter-customize').click() + cy.get('#customize').should('not.be.visible').and('not.have.class', 'in') + }) + + it('customize panel should have at least 3 areas', () => { + cy.get('#agenda-filter-customize').click() + cy.get('.agenda-filter-areaselectbtn').should('have.length.at.least', 3) + }) + + it('customize panel should have at least 10 groups', () => { + cy.get('.agenda-filter-groupselectbtn').should('have.length.at.least', 10) + }) + + it('filtering the agenda should modify the URL', () => { + // cy.intercept({ + // method: 'GET', + // path: '/meeting/agenda/week-view.html**', + // times: 10 + // }, { + // forceNetworkError: true + // }) + + cy.get('.agenda-filter-groupselectbtn').any(5).as('selectedGroups').each(randomElement => { + cy.wrap(randomElement).click() + cy.wrap(randomElement).invoke('attr', 'data-filter-item').then(keyword => { + cy.url().should('contain', keyword) + }) }) - it('customize panel should have at least 3 areas', () => { - cy.get('#agenda-filter-customize').click() - cy.get('.agenda-filter-areaselectbtn').should('have.length.at.least', 3) - }) + // Deselect everything + cy.get('@selectedGroups').click({ multiple: true }) + }) - it('customize panel should have at least 10 groups', () => { - cy.get('.agenda-filter-groupselectbtn').should('have.length.at.least', 10) - }) + it('selecting an area should select all corresponding groups', () => { + cy.get('.agenda-filter-areaselectbtn').any().click().invoke('attr', 'data-filter-item').then(area => { + cy.url().should('contain', area) - it('filtering the agenda should modify the URL', () => { - // cy.intercept({ - // method: 'GET', - // path: '/meeting/agenda/week-view.html**', - // times: 10 - // }, { - // forceNetworkError: true - // }) - - cy.get('.agenda-filter-groupselectbtn').any(5).as('selectedGroups').each(randomElement => { - cy.wrap(randomElement).click() - cy.wrap(randomElement).invoke('attr', 'data-filter-item').then(keyword => { - cy.url().should('contain', keyword) - }) + cy.get(`.agenda-filter-groupselectbtn[data-filter-keywords*="${area}"]`).each(group => { + cy.wrap(group).invoke('attr', 'data-filter-keywords').then(groupKeywords => { + // In case value is a comma-separated list of keywords... + if (groupKeywords.indexOf(',') < 0 || groupKeywords.split(',').includes(area)) { + cy.wrap(group).should('have.class', 'active') + } }) - - // Deselect everything - cy.get('@selectedGroups').click({ multiple: true }) + }) }) + }) - it('selecting an area should select all corresponding groups', () => { - cy.get('.agenda-filter-areaselectbtn').any().click().invoke('attr', 'data-filter-item').then(area => { - cy.url().should('contain', area) - - cy.get(`.agenda-filter-groupselectbtn[data-filter-keywords*="${area}"]`).each(group => { - cy.wrap(group).invoke('attr', 'data-filter-keywords').then(groupKeywords => { - // In case value is a comma-separated list of keywords... - if (groupKeywords.indexOf(',') < 0 || groupKeywords.split(',').includes(area)) { - cy.wrap(group).should('have.class', 'active') - } - }) - }) - }) - }) - - it('weekview iframe should load', () => { - cy.get('iframe#weekview').its('0.contentDocument').should('exist') - cy.get('iframe#weekview').its('0.contentDocument.readyState').should('equal', 'complete') - cy.get('iframe#weekview').its('0.contentDocument.body', { - timeout: 30000 - }).should('not.be.empty') - }) + it('weekview iframe should load', () => { + cy.get('iframe#weekview').its('0.contentDocument').should('exist') + cy.get('iframe#weekview').its('0.contentDocument.readyState').should('equal', 'complete') + cy.get('iframe#weekview').its('0.contentDocument.body', { + timeout: 30000 + }).should('not.be.empty') + }) }) describe('meeting agenda weekview', () => { - before(() => { - cy.visit('/meeting/agenda/week-view.html') - }) - it('should have day headers', () => { - cy.get('.agenda-weekview-day').should('have.length.greaterThan', 0).and('be.visible') - }) - it('should have day columns', () => { - cy.get('.agenda-weekview-column').should('have.length.greaterThan', 0).and('be.visible') - }) + before(() => { + cy.visit('/meeting/agenda/week-view.html') + }) + it('should have day headers', () => { + cy.get('.agenda-weekview-day').should('have.length.greaterThan', 0).and('be.visible') + }) + it('should have day columns', () => { + cy.get('.agenda-weekview-column').should('have.length.greaterThan', 0).and('be.visible') + }) - it('should have the same number of day headers and columns', () => { - cy.get('.agenda-weekview-day').its('length').then(lgth => { - cy.get('.agenda-weekview-column').should('have.length', lgth) - }) + it('should have the same number of day headers and columns', () => { + cy.get('.agenda-weekview-day').its('length').then(lgth => { + cy.get('.agenda-weekview-column').should('have.length', lgth) }) + }) - it('should have meetings', () => { - cy.get('.agenda-weekview-meeting').should('have.length.greaterThan', 0).and('be.visible') - }) + it('should have meetings', () => { + cy.get('.agenda-weekview-meeting').should('have.length.greaterThan', 0).and('be.visible') + }) - it('meeting hover should cause expansion to column width', () => { - cy.get('.agenda-weekview-column:first').invoke('outerWidth').then(colWidth => { - cy.get('.agenda-weekview-meeting-mini').any(5).each(meeting => { - cy.wrap(meeting) - .wait(250) - .realHover({ position: 'center' }) - .invoke('outerWidth') - .should('be.closeTo', colWidth, 1) - // Move over to top left corner of the page to end the mouseover of the current meeting block - cy.get('.agenda-weekview-day:first').realHover().wait(250) - }) - }) + it('meeting hover should cause expansion to column width', () => { + cy.get('.agenda-weekview-column:first').invoke('outerWidth').then(colWidth => { + cy.get('.agenda-weekview-meeting-mini').any(5).each(meeting => { + cy.wrap(meeting) + .wait(250) + .realHover({ position: 'center' }) + .invoke('outerWidth') + .should('be.closeTo', colWidth, 1) + // Move over to top left corner of the page to end the mouseover of the current meeting block + cy.get('.agenda-weekview-day:first').realHover().wait(250) + }) }) -}) \ No newline at end of file + }) +}) diff --git a/cypress/integration/nomcom/expertise.spec.js b/cypress/integration/nomcom/expertise.spec.js index c1d58c57d..a4af14389 100644 --- a/cypress/integration/nomcom/expertise.spec.js +++ b/cypress/integration/nomcom/expertise.spec.js @@ -1,27 +1,27 @@ /// describe('expertise', () => { - before(() => { - cy.visit('/nomcom/2021/expertise/') - }) - - it('expertises with expandable panels should expand', () => { - cy.get('.nomcom-req-positions-tabs > li > a').each($tab => { - cy.wrap($tab).click() - cy.wrap($tab).parent().should('have.class', 'active') + before(() => { + cy.visit('/nomcom/2021/expertise/') + }) - cy.wrap($tab).invoke('attr', 'href').then($tabId => { - cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible') + it('expertises with expandable panels should expand', () => { + cy.get('.nomcom-req-positions-tabs > li > a').each($tab => { + cy.wrap($tab).click() + cy.wrap($tab).parent().should('have.class', 'active') - cy.get($tabId).then($tabContent => { - if ($tabContent.find('.generic_iesg_reqs_header').length) { - cy.wrap($tabContent).find('.generic_iesg_reqs_header').click() - cy.wrap($tabContent).find('.generic_iesg_reqs_header').invoke('attr', 'href').then($expandId => { - cy.get($expandId).should('be.visible') - }) - } - }) + cy.wrap($tab).invoke('attr', 'href').then($tabId => { + cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible') + + cy.get($tabId).then($tabContent => { + if ($tabContent.find('.generic_iesg_reqs_header').length) { + cy.wrap($tabContent).find('.generic_iesg_reqs_header').click() + cy.wrap($tabContent).find('.generic_iesg_reqs_header').invoke('attr', 'href').then($expandId => { + cy.get($expandId).should('be.visible') }) + } }) + }) }) -}) \ No newline at end of file + }) +}) diff --git a/cypress/integration/nomcom/questionnaires.spec.js b/cypress/integration/nomcom/questionnaires.spec.js index 0bbdfd0cd..b6d28e2cf 100644 --- a/cypress/integration/nomcom/questionnaires.spec.js +++ b/cypress/integration/nomcom/questionnaires.spec.js @@ -1,18 +1,18 @@ /// describe('questionnaires', () => { - before(() => { - cy.visit('/nomcom/2021/questionnaires/') - }) - - it('position tabs should display the appropriate panel on click', () => { - cy.get('.nomcom-questnr-positions-tabs > li > a').each($tab => { - cy.wrap($tab).click() - cy.wrap($tab).parent().should('have.class', 'active') + before(() => { + cy.visit('/nomcom/2021/questionnaires/') + }) - cy.wrap($tab).invoke('attr', 'href').then($tabId => { - cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible') - }) - }) + it('position tabs should display the appropriate panel on click', () => { + cy.get('.nomcom-questnr-positions-tabs > li > a').each($tab => { + cy.wrap($tab).click() + cy.wrap($tab).parent().should('have.class', 'active') + + cy.wrap($tab).invoke('attr', 'href').then($tabId => { + cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible') + }) }) -}) \ No newline at end of file + }) +}) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 3cc5bffab..dc23a6ca3 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -25,10 +25,10 @@ // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) Cypress.Commands.add('any', { prevSubject: 'element' }, (subject, size = 1) => { - cy.wrap(subject).then(elementList => { - elementList = (elementList.jquery) ? elementList.get() : elementList - elementList = Cypress._.sampleSize(elementList, size) - elementList = (elementList.length > 1) ? elementList : elementList[0] - cy.wrap(elementList) - }) -}) \ No newline at end of file + cy.wrap(subject).then(elementList => { + elementList = (elementList.jquery) ? elementList.get() : elementList + elementList = Cypress._.sampleSize(elementList, size) + elementList = (elementList.length > 1) ? elementList : elementList[0] + cy.wrap(elementList) + }) +})