Skip to content

Commit

Permalink
feat: beginning timeline tests AB#13480
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisvisser committed Apr 25, 2022
1 parent dfdc9c2 commit 88fb1e9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
: 'ibf-no-alert-tertiary'
}}"
fill="solid"
data-test="time-line-button"
data-test="timeline-button"
[class.active]="timeStepButton.active"
[class.alert]="timeStepButton.alert && !timeStepButton?.disabled"
(click)="handleTimeStepButtonClick(timeStepButton.value)"
Expand Down
19 changes: 12 additions & 7 deletions tests/cypress/integration/IBF-dashboard/timeline-component.spec.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import selectors from '../../support/selectors';

// timeline validation
describe('timeline validation', () => {
describe('timeline component', () => {
beforeEach(() => {
cy.login();
});

it('load and validate timeLineButton', () => {
cy.get(selectors.timelineButton)
.should('be.visible')
.should('not.be.disabled');
it('should load at least 1 timeline button', () => {
cy.get(selectors.timeline.timelineButton).should('be.visible');
});

it('should load at least 1 active timeline button', () => {
cy.get(selectors.timeline.timelineButtonActive).should('be.visible');
});

it('should load at least 1 triggered button IF dashboard in triggered state');

it('should load 0 triggered button IF dashboard in non-triggered state');

it('click on active timeline button', () => {
cy.get(selectors.timelineButtonActive).as('Activebutton');
cy.get(selectors.timeline.timelineButtonActive).as('Activebutton');
cy.get('@Activebutton').then(($button) => {
cy.wrap($button).should('be.visible').should('not.be.disabled').click();
});
Expand Down
1 change: 1 addition & 0 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Cypress.Commands.add('waitForAngular', () => {
});
});
});

/* check trigger*/
Cypress.Commands.add('isStatusTriggered', () => {
cy.get(selectors.triggerActiveTrue);
Expand Down
8 changes: 4 additions & 4 deletions tests/cypress/support/selectors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export default {
timeline: {
timelineButton: '[data-test=timeline-button]',
timelineButtonActive: '[data-test=timeline-button].active',
},
pageTitle: "[data-test='page-title']",
inputUser: "[data-test='input-user'] input",
inputPassword: "[data-test='input-password'] input",
Expand All @@ -12,14 +16,10 @@ export default {
loader: "[data-test='loader']",
videoGuidebutton: '[data-test=video-guide-button]',
videoGuideclosebutton: '[data-test=video-popover] .icon-large',
timelineButton: '[data-test=time-line-button]',
timelineButtonActive: '[data-test=time-line-button].active',
aggregateList: '[data-test=aggregate-list]',
aggregateNumber: '[data-test=aggregate-number]',
ExposedaggregateNumber: ':nth-child(1)>>>[data-test=aggregate-number]',
TotalaggregateNumber: ':nth-child(2)>>>[data-test=aggregate-number]',
CattleExposedNumber: ':nth-child(4)>>>[data-test=aggregate-number]',
SamllRuminantNumber: ':nth-child(5)>>>[data-test=aggregate-number]',
AggregatePopupicon: ':nth-child(1)>>[data-test=icon-row]',
disastertypes: '[data-test=disaster-Type]',
disasterlabel: '[data-test=disaster-labelname]',
Expand Down

0 comments on commit 88fb1e9

Please sign in to comment.