-
Notifications
You must be signed in to change notification settings - Fork 249
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
Chore: Added menu page e2e tests (Issue/3468) #3469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
test/e2e/menuPage.cy.js
Outdated
it(`should have the title '${Course.displayTitle}' and correct description`, () => { | ||
cy.get('.menu__title-inner').should('contain', Course.displayTitle); | ||
cy.get('.menu__body-inner').should('contain', Course.body); | ||
}); | ||
|
||
it(`should display ${Content.length} menu tiles`, () => { | ||
cy.get('.menu-item').should('have.length', Content.length) | ||
|
||
cy.get('.menu-item').each(($item, index) => { | ||
cy.get($item).within(() => { | ||
cy.get('.menu-item__title').should('contain', Content[index].displayTitle) | ||
cy.get('.menu-item__body').should('contain', Content[index].body) | ||
cy.get('button').should('contain', Content[index].linkText) | ||
cy.get('.menu-item__duration').should('contain', Content[index].duration) | ||
cy.get('img.menu-item__image').should('exist').should('have.attr', 'src', Content[index]._graphic.src) | ||
}) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really live in adapt-contrib-boxmenu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean that it should live in the plugin adapt-contrib-boxmenu repo, not in the adapt_framework repo
test/e2e/menuPage.cy.js
Outdated
it('should have an expandable drawer', () => { | ||
cy.get('.drawer[aria-expanded="true"]').should('not.exist') | ||
cy.get('.drawer[aria-expanded="false"]').should('exist') | ||
|
||
cy.get('button[data-event="toggleDrawer"]').click() | ||
|
||
cy.get('.drawer[aria-expanded="true"]').should('exist') | ||
cy.get('.drawer[aria-expanded="false"]').should('not.exist') | ||
|
||
cy.get('button.drawer__close-btn').click() | ||
|
||
cy.get('.drawer[aria-expanded="true"]').should('not.exist') | ||
cy.get('.drawer[aria-expanded="false"]').should('exist') | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in a drawer.cy.js file, or in adapt-contrib-resources, it's very difficult to know if the course has a drawer unless a plugin which requires the drawer is installed.
New data loading needs to be implemented. |
addresses adaptlearning/adapt-contrib-boxMenu#167