misc: add .gitignore + fix cypress files to match JS style guide

Commit ready for merge.
 - Legacy-Id: 19751
This commit is contained in:
nick 2021-12-07 03:42:44 +00:00
parent dddaebd0f3
commit bf4e7474a1
5 changed files with 138 additions and 123 deletions

View file

@ -6,6 +6,7 @@ root = true
# Settings for IETF datatracker # Settings for IETF datatracker
# --------------------------------------------------------- # ---------------------------------------------------------
# PEP8 Style
[*] [*]
indent_style = space indent_style = space
@ -18,6 +19,7 @@ insert_final_newline = false
# Settings for .github folder # Settings for .github folder
# --------------------------------------------------------- # ---------------------------------------------------------
# GitHub Markdown Style
[.github/**] [.github/**]
indent_style = space indent_style = space
@ -29,6 +31,7 @@ insert_final_newline = true
# Settings for client-side JS / Vue files # Settings for client-side JS / Vue files
# --------------------------------------------------------- # ---------------------------------------------------------
# StandardJS Style
[client/**] [client/**]
indent_style = space indent_style = space
@ -36,4 +39,16 @@ indent_size = 2
end_of_line = lf end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true 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 insert_final_newline = true

View file

@ -1,103 +1,103 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('meeting agenda', () => { describe('meeting agenda', () => {
before(() => { before(() => {
cy.visit('/meeting/agenda/') 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')
cy.get('#agenda-filter-customize').click() it('toggle customize panel when clicking on customize header bar', () => {
cy.get('#customize').should('not.be.visible').and('not.have.class', 'in') 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', () => { // Deselect everything
cy.get('#agenda-filter-customize').click() cy.get('@selectedGroups').click({ multiple: true })
cy.get('.agenda-filter-areaselectbtn').should('have.length.at.least', 3) })
})
it('customize panel should have at least 10 groups', () => { it('selecting an area should select all corresponding groups', () => {
cy.get('.agenda-filter-groupselectbtn').should('have.length.at.least', 10) 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.get(`.agenda-filter-groupselectbtn[data-filter-keywords*="${area}"]`).each(group => {
// cy.intercept({ cy.wrap(group).invoke('attr', 'data-filter-keywords').then(groupKeywords => {
// method: 'GET', // In case value is a comma-separated list of keywords...
// path: '/meeting/agenda/week-view.html**', if (groupKeywords.indexOf(',') < 0 || groupKeywords.split(',').includes(area)) {
// times: 10 cy.wrap(group).should('have.class', 'active')
// }, { }
// 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)
})
}) })
})
// Deselect everything
cy.get('@selectedGroups').click({ multiple: true })
}) })
})
it('selecting an area should select all corresponding groups', () => { it('weekview iframe should load', () => {
cy.get('.agenda-filter-areaselectbtn').any().click().invoke('attr', 'data-filter-item').then(area => { cy.get('iframe#weekview').its('0.contentDocument').should('exist')
cy.url().should('contain', area) cy.get('iframe#weekview').its('0.contentDocument.readyState').should('equal', 'complete')
cy.get('iframe#weekview').its('0.contentDocument.body', {
cy.get(`.agenda-filter-groupselectbtn[data-filter-keywords*="${area}"]`).each(group => { timeout: 30000
cy.wrap(group).invoke('attr', 'data-filter-keywords').then(groupKeywords => { }).should('not.be.empty')
// 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')
})
}) })
describe('meeting agenda weekview', () => { describe('meeting agenda weekview', () => {
before(() => { before(() => {
cy.visit('/meeting/agenda/week-view.html') cy.visit('/meeting/agenda/week-view.html')
}) })
it('should have day headers', () => { it('should have day headers', () => {
cy.get('.agenda-weekview-day').should('have.length.greaterThan', 0).and('be.visible') cy.get('.agenda-weekview-day').should('have.length.greaterThan', 0).and('be.visible')
}) })
it('should have day columns', () => { it('should have day columns', () => {
cy.get('.agenda-weekview-column').should('have.length.greaterThan', 0).and('be.visible') cy.get('.agenda-weekview-column').should('have.length.greaterThan', 0).and('be.visible')
}) })
it('should have the same number of day headers and columns', () => { it('should have the same number of day headers and columns', () => {
cy.get('.agenda-weekview-day').its('length').then(lgth => { cy.get('.agenda-weekview-day').its('length').then(lgth => {
cy.get('.agenda-weekview-column').should('have.length', lgth) cy.get('.agenda-weekview-column').should('have.length', lgth)
})
}) })
})
it('should have meetings', () => { it('should have meetings', () => {
cy.get('.agenda-weekview-meeting').should('have.length.greaterThan', 0).and('be.visible') cy.get('.agenda-weekview-meeting').should('have.length.greaterThan', 0).and('be.visible')
}) })
it('meeting hover should cause expansion to column width', () => { it('meeting hover should cause expansion to column width', () => {
cy.get('.agenda-weekview-column:first').invoke('outerWidth').then(colWidth => { cy.get('.agenda-weekview-column:first').invoke('outerWidth').then(colWidth => {
cy.get('.agenda-weekview-meeting-mini').any(5).each(meeting => { cy.get('.agenda-weekview-meeting-mini').any(5).each(meeting => {
cy.wrap(meeting) cy.wrap(meeting)
.wait(250) .wait(250)
.realHover({ position: 'center' }) .realHover({ position: 'center' })
.invoke('outerWidth') .invoke('outerWidth')
.should('be.closeTo', colWidth, 1) .should('be.closeTo', colWidth, 1)
// Move over to top left corner of the page to end the mouseover of the current meeting block // 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) cy.get('.agenda-weekview-day:first').realHover().wait(250)
}) })
})
}) })
}) })
})

View file

@ -1,27 +1,27 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('expertise', () => { describe('expertise', () => {
before(() => { before(() => {
cy.visit('/nomcom/2021/expertise/') 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')
cy.wrap($tab).invoke('attr', 'href').then($tabId => { it('expertises with expandable panels should expand', () => {
cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible') 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 => { cy.wrap($tab).invoke('attr', 'href').then($tabId => {
if ($tabContent.find('.generic_iesg_reqs_header').length) { cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible')
cy.wrap($tabContent).find('.generic_iesg_reqs_header').click()
cy.wrap($tabContent).find('.generic_iesg_reqs_header').invoke('attr', 'href').then($expandId => { cy.get($tabId).then($tabContent => {
cy.get($expandId).should('be.visible') 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')
}) })
}
}) })
})
}) })
}) })
})

View file

@ -1,18 +1,18 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('questionnaires', () => { describe('questionnaires', () => {
before(() => { before(() => {
cy.visit('/nomcom/2021/questionnaires/') 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')
cy.wrap($tab).invoke('attr', 'href').then($tabId => { it('position tabs should display the appropriate panel on click', () => {
cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible') 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')
})
}) })
}) })
})

View file

@ -25,10 +25,10 @@
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
Cypress.Commands.add('any', { prevSubject: 'element' }, (subject, size = 1) => { Cypress.Commands.add('any', { prevSubject: 'element' }, (subject, size = 1) => {
cy.wrap(subject).then(elementList => { cy.wrap(subject).then(elementList => {
elementList = (elementList.jquery) ? elementList.get() : elementList elementList = (elementList.jquery) ? elementList.get() : elementList
elementList = Cypress._.sampleSize(elementList, size) elementList = Cypress._.sampleSize(elementList, size)
elementList = (elementList.length > 1) ? elementList : elementList[0] elementList = (elementList.length > 1) ? elementList : elementList[0]
cy.wrap(elementList) cy.wrap(elementList)
}) })
}) })