Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cypress/e2e/po/components/create-edit-view.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import AsyncButtonPo from '@/cypress/e2e/po/components/async-button.po';
import NameNsDescription from '@/cypress/e2e/po/components/name-ns-description.po';

export default class CreateEditViewPo extends ComponentPo {
errorBanner() {
return this.self().find('#cru-errors');
}

nameNsDescription() {
return new NameNsDescription(this.self());
}
Expand Down
35 changes: 0 additions & 35 deletions cypress/e2e/po/components/storage/config-map.po.ts

This file was deleted.

43 changes: 26 additions & 17 deletions cypress/e2e/po/pages/explorer/config-map.po.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import PagePo from '@/cypress/e2e/po/pages/page.po';
import BaseResourceList from '@/cypress/e2e/po/lists/base-resource-list.po';
import { BaseListPagePo } from '@/cypress/e2e/po/pages/base/base-list-page.po';
import { BaseDetailPagePo } from '@/cypress/e2e/po/pages/base/base-detail-page.po';
import BurgerMenuPo from '@/cypress/e2e/po/side-bars/burger-side-menu.po';
import ProductNavPo from '@/cypress/e2e/po/side-bars/product-side-nav.po';

export class ConfigMapPagePo extends PagePo {
import InputPo from '@/cypress/e2e/po/components/input.po';
import CodeMirrorPo from '@/cypress/e2e/po/components/code-mirror.po';
export class ConfigMapListPagePo extends BaseListPagePo {
private static createPath(clusterId: string) {
return `/c/${ clusterId }/explorer/configmap`;
}

static goTo(clusterId: string): Cypress.Chainable<Cypress.AUTWindow> {
return super.goTo(ConfigMapPagePo.createPath(clusterId));
return super.goTo(ConfigMapListPagePo.createPath(clusterId));
}

static navTo(clusterId = 'local') {
Expand All @@ -22,28 +23,36 @@ export class ConfigMapPagePo extends PagePo {
}

constructor(clusterId = 'local') {
super(ConfigMapPagePo.createPath(clusterId));
super(ConfigMapListPagePo.createPath(clusterId));
}

list() {
return new BaseResourceList(this.self());
searchForConfigMap(name: string) {
this.list().resourceTable().sortableTable().filter(name);

return cy.url().should('include', `q=${ name }`);
}
}

clickCreate() {
return this.list().masthead().create();
export class ConfigMapCreateEditPagePo extends BaseDetailPagePo {
private static createPath(clusterId: string, namespace?: string, id?: string ) {
const root = `/c/${ clusterId }/explorer/configmap`;

return id ? `${ root }/${ namespace }/${ id }` : `${ root }/create`;
}

listElementWithName(name:string) {
return this.list().resourceTable().sortableTable().rowElementWithName(name);
static goTo(path: string): Cypress.Chainable<Cypress.AUTWindow> {
throw new Error('invalid');
}

searchForConfigMap(name: string) {
this.list().resourceTable().sortableTable().filter(name);
constructor(clusterId = 'local', namespace?: string, id?: string) {
super(ConfigMapCreateEditPagePo.createPath(clusterId, namespace, id));
}

return cy.url().should('include', `q=${ name }`);
keyInput() {
return InputPo.bySelector(this.self(), '[data-testid="input-kv-item-key-0"]');
}

title() {
return this.self().get('.title h1').invoke('text');
valueInput() {
return CodeMirrorPo.bySelector(this.self(), '[data-testid="code-mirror-multiline-field"]');
}
}
4 changes: 2 additions & 2 deletions cypress/e2e/tests/pages/explorer2/resource-search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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 { ConfigMapPagePo } from '@/cypress/e2e/po/pages/explorer/config-map.po';
import { ConfigMapListPagePo } from '@/cypress/e2e/po/pages/explorer/config-map.po';

const clusterDashboard = new ClusterDashboardPagePo('local');

Expand Down Expand Up @@ -77,7 +77,7 @@ describe('Cluster Dashboard', { testIsolation: 'off', tags: ['@explorer2', '@adm

dialog.results().first().click();

const configMapPage = new ConfigMapPagePo('local');
const configMapPage = new ConfigMapListPagePo('local');

configMapPage.waitForPage();

Expand Down
Loading