qe-fe-automation
Version:
FE test automation framework using cypress
34 lines (30 loc) • 1.34 kB
text/typescript
import { Timeouts } from '@utility-lib/index';
const liveMapPageSelectors = {
nowSliderPosition: '[class^="now"]',
mapContainer: '[data-appcue-id="livemapPage_map_enUS"]',
yesterDayLabel: '[data-qa-id="LIVE_MAP_YESTERDAY"]',
tomorrowLabel: '[data-qa-id="LIVE_MAP_TOMORROW"]',
travelersSearchInput: '[placeholder="Find travelers"]',
sliderCaret: '[data-qa-id="LIVE_MAP_SLIDER"]'
};
export class LiveMapPage {
static visitActiveTravelersLiveMap() {
cy.allure().logStep('Visit active travelers live map page');
cy.intercept('GET', /admin\/dashboard\/livemap?/).as('waitForLiveMap');
cy.visit('app/admin2/en/activeTravelers/livemap');
cy.url().should('include', '/livemap');
cy.wait('@waitForLiveMap');
}
static verifyActiveTravelersLiveMapPageElements() {
cy.allure().logStep('Verify active travelers live map page elements');
cy.get(liveMapPageSelectors.nowSliderPosition).should('be.visible');
cy.get(liveMapPageSelectors.mapContainer).should('be.visible');
cy.get(liveMapPageSelectors.yesterDayLabel).should('be.visible');
cy.get(liveMapPageSelectors.tomorrowLabel).should('be.visible');
cy.get(liveMapPageSelectors.travelersSearchInput).should('be.visible');
cy.get(liveMapPageSelectors.sliderCaret).contains(
'Now',
Timeouts.MEDIUM_TIMEOUT_60_SEC
);
}
}