forked from openshift/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
samples-page.ts
33 lines (32 loc) · 973 Bytes
/
samples-page.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { samplesPO } from '../../pageObjects/add-flow-po';
export const samplesPage = {
search: (keyword: string) => {
cy.get('.skeleton-catalog--grid').should('not.exist');
cy.get(samplesPO.search).clear().type(keyword);
},
selectCardInSamples: (card: string) => {
cy.get('.skeleton-catalog--grid').should('not.exist');
cy.byLegacyTestID('perspective-switcher-toggle').click();
switch (card) {
case 'Httpd': {
cy.get(samplesPO.cards.httpdTemplate).first().click();
break;
}
case 'Basic Go': {
cy.get(samplesPO.cards.basicgoTemplate).first().click();
break;
}
case 'Basic Node.js': {
cy.get(samplesPO.cards.basicnodeTemplate).first().click();
break;
}
case 'Go': {
cy.get(samplesPO.cards.goTemplate).first().click();
break;
}
default: {
throw new Error(`${card} card is not available in Catalog`);
}
}
},
};