Skip to content
Snippets Groups Projects
Commit 198a0593 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

add nshmp-lib utils

parent 65ae869b
No related branches found
No related tags found
2 merge requests!147Production Release | nshmp-apps,!143Cypress tests
export interface ControlPanelButtons {
hasSubmitButton: boolean;
hasServiceCallButton: boolean;
hasResetButton: boolean;
}
export function controlPanelButtonsEnabled(buttons: ControlPanelButtons) {
cy.get('nshmp-lib-control-panel-buttons').find('.form-buttons').as('buttons');
if (buttons.hasResetButton) {
cy.get('@buttons')
.find('.reset-button')
.should('be.visible')
.find('button')
.should('be.enabled');
}
if (buttons.hasServiceCallButton) {
cy.get('@buttons')
.find('.service-button')
.should('be.visible')
.find('button')
.should('be.enabled')
.click();
hasServiceCallPopUp();
cy.get('body').click();
}
if (buttons.hasSubmitButton) {
cy.get('@buttons')
.find('.submit-button')
.should('be.visible')
.find('button')
.should('be.enabled');
}
}
export function controlPanelButtonsNotEnabled(buttons: ControlPanelButtons) {
cy.get('nshmp-lib-control-panel-buttons').find('.form-buttons').as('buttons');
if (buttons.hasResetButton) {
cy.get('@buttons').find('.reset-button').should('be.visible').should('not.be.enabled');
}
if (buttons.hasServiceCallButton) {
cy.get('@buttons').find('.service-button').should('be.visible').should('not.be.enabled');
}
if (buttons.hasSubmitButton) {
cy.get('@buttons').find('.submit-button').should('be.visible').should('not.be.enabled');
}
}
export function hasServiceCallPopUp() {
cy.get('nshmp-lib-url-bottom-sheet').should('be.visible');
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment