misc: add .gitignore + fix cypress files to match JS style guide
Commit ready for merge. - Legacy-Id: 19751
This commit is contained in:
parent
dddaebd0f3
commit
bf4e7474a1
|
@ -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
|
||||
|
@ -37,3 +40,15 @@ 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
|
|
@ -1,103 +1,103 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
describe('meeting agenda', () => {
|
||||
before(() => {
|
||||
cy.visit('/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')
|
||||
|
||||
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('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')
|
||||
// Deselect everything
|
||||
cy.get('@selectedGroups').click({ multiple: true })
|
||||
})
|
||||
|
||||
cy.get('#agenda-filter-customize').click()
|
||||
cy.get('#customize').should('not.be.visible').and('not.have.class', 'in')
|
||||
})
|
||||
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('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)
|
||||
})
|
||||
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)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
|
@ -1,27 +1,27 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
describe('expertise', () => {
|
||||
before(() => {
|
||||
cy.visit('/nomcom/2021/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')
|
||||
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 => {
|
||||
cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('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')
|
||||
})
|
||||
}
|
||||
})
|
||||
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')
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
|
@ -1,18 +1,18 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
describe('questionnaires', () => {
|
||||
before(() => {
|
||||
cy.visit('/nomcom/2021/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')
|
||||
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')
|
||||
})
|
||||
})
|
||||
cy.wrap($tab).invoke('attr', 'href').then($tabId => {
|
||||
cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
|
@ -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)
|
||||
})
|
||||
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)
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue