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

add e2e utils

parent beb40aba
No related branches found
No related tags found
2 merge requests!147Production Release | nshmp-apps,!143Cypress tests
export * from './dashboard.utils';
export * from './gmm-lib.utils';
export * from './hazard-lib.utils';
export * from './nshmp-lib.utils';
export * from './nshmp-template.utils';
export * from './plot-lib.utils';
export * from './utils';
export function hasDownloadedFile(filename: string) {
const downloadsFolder = Cypress.config('downloadsFolder');
const file = `${downloadsFolder}/${filename}`;
cy.readFile(file).should('exist').should('have.length.above', 1);
}
export function setInput(inputClass: string, value: string) {
cy.get('nshmp-template-control-panel')
.find(inputClass)
.find('input')
.scrollIntoView()
.should('be.visible')
.clear()
.type(value)
.should('have.value', value);
}
export function selectMatOption(value: string) {
cy.get('.cdk-overlay-container')
.find('mat-option')
.each(option => {
if (option.attr('ng-reflect-value') === value) {
cy.wrap(option).click();
}
});
}
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