-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathresource-search.spec.ts
More file actions
86 lines (58 loc) · 2.54 KB
/
resource-search.spec.ts
File metadata and controls
86 lines (58 loc) · 2.54 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import HomePagePo from '@/cypress/e2e/po/pages/home.po';
import ClusterDashboardPagePo from '@/cypress/e2e/po/pages/explorer/cluster-dashboard.po';
import ResourceSearchDialog from '@/cypress/e2e/po/prompts/ResourceSearchDialog.po';
import { NamespaceFilterPo } from '@/cypress/e2e/po/components/namespace-filter.po';
import { ConfigMapListPagePo } from '@/cypress/e2e/po/pages/explorer/config-map.po';
const clusterDashboard = new ClusterDashboardPagePo('local');
describe('Cluster Dashboard', { testIsolation: false, tags: ['@explorer2', '@adminUser', '@standardUser'] }, () => {
before(() => {
cy.login();
HomePagePo.goTo();
ClusterDashboardPagePo.navTo();
});
it('can show resource search dialog', () => {
// Open the resource search
clusterDashboard.clusterActionsHeader().resourceSearchButton().click();
const dialog = new ResourceSearchDialog();
dialog.checkExists();
dialog.checkVisible();
dialog.searchBox().type('ConfigMap');
dialog.results().should('have.length', 1);
dialog.results().first().should('have.text', 'ConfigMaps');
dialog.close();
dialog.checkNotExists();
});
it('can search by resource group', () => {
// Open the resource search
clusterDashboard.clusterActionsHeader().resourceSearchButton().click();
const dialog = new ResourceSearchDialog();
dialog.checkExists();
dialog.checkVisible();
dialog.searchBox().type('provisioning.cattle');
// Wait for less than 20 - then we know the results are updated for our search
dialog.results().should('have.length.lt', 20);
dialog.results().should('have.length.gt', 0);
dialog.results().first().should('have.text', 'Clusters (clusters.provisioning.cattle.io)');
dialog.close();
dialog.checkNotExists();
});
it('can show resource dialog when namespace chooser is open', () => {
const namespacePicker = new NamespaceFilterPo();
namespacePicker.toggle();
namespacePicker.clickOptionByLabel('Only User Namespaces');
namespacePicker.isChecked('Only User Namespaces');
// Namespace filter is still open
const dialog = new ResourceSearchDialog();
// Open the resource search
dialog.open();
dialog.checkExists();
dialog.checkVisible();
dialog.searchBox().type('ConfigMap');
dialog.results().should('have.length', 1);
dialog.results().first().should('have.text', 'ConfigMaps');
dialog.results().first().click();
const configMapPage = new ConfigMapListPagePo('local');
configMapPage.waitForPage();
dialog.checkNotExists();
});
});