Skip to content

Commit

Permalink
use default cy.visit function
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvogt committed Apr 5, 2024
1 parent d2117a5 commit 91a5d00
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import { ProjectModel } from '~/__tests__/cypress/cypress/utils/models';
describe('Data science projects details', () => {
it('should start with an empty project list', () => {
initIntercepts();
cy.visitWithLogin('/projects');
cy.visit('/projects');
projectListPage.shouldBeEmpty();
});

it('should open a modal to create a project', () => {
initIntercepts();
cy.visitWithLogin('/projects');
cy.visit('/projects');
projectListPage.findCreateProjectButton().click();
createProjectModal.shouldBeOpen();
createProjectModal.findCancelButton().click();
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('Data science projects details', () => {
};

cy.intercept({ pathname: '/api/k8s/apis/project.openshift.io/v1/projects' }, projectsMock);
cy.visitWithLogin('/projects');
cy.visit('/projects');

projectListPage.shouldHaveProjects();
projectListPage.findProjectLink('DS Project 1').should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TolerationRow extends TableRow {

class AcceleratorProfile {
visit() {
cy.visitWithLogin('/acceleratorProfiles');
cy.visit('/acceleratorProfiles');
this.wait();
}

Expand Down Expand Up @@ -198,7 +198,7 @@ class TolerationsModal extends Modal {

class CreateAcceleratorProfile extends ManageAcceleratorProfile {
visit() {
cy.visitWithLogin('/acceleratorProfiles/Create');
cy.visit('/acceleratorProfiles/Create');
this.wait();
}

Expand All @@ -210,7 +210,7 @@ class CreateAcceleratorProfile extends ManageAcceleratorProfile {

class EditAcceleratorProfile extends ManageAcceleratorProfile {
visit(name: string) {
cy.visitWithLogin(`/acceleratorProfiles/edit/${name}`);
cy.visit(`/acceleratorProfiles/edit/${name}`);
cy.testA11y();
}

Expand All @@ -225,7 +225,7 @@ class EditAcceleratorProfile extends ManageAcceleratorProfile {

class IdentifierAcceleratorProfile extends ManageAcceleratorProfile {
visit(multiple = false) {
cy.visitWithLogin(
cy.visit(
multiple
? `/acceleratorProfiles/create?identifiers=test-identifier%2Ctest-identifier2`
: `/acceleratorProfiles/create?identifiers=test-identifier`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { appChrome } from '~/__tests__/cypress/cypress/pages/appChrome';

class ClusterSettings {
visit() {
cy.visitWithLogin('/clusterSettings');
cy.visit('/clusterSettings');
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ClusterStorageModal extends Modal {

class ClusterStorage {
visit(projectName: string) {
cy.visitWithLogin(`/projects/${projectName}?section=cluster-storages`);
cy.visit(`/projects/${projectName}?section=cluster-storages`);
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { appChrome } from '~/__tests__/cypress/cypress/pages/appChrome';

class GlobalDistributedWorkloads {
visit(wait = true) {
cy.visitWithLogin(`/distributedWorkloads`);
cy.visit(`/distributedWorkloads`);
if (wait) {
this.wait();
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/__tests__/cypress/cypress/pages/enabled.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class EnabledPage {
visit() {
cy.visitWithLogin('/');
cy.visit('/');
this.wait();
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/__tests__/cypress/cypress/pages/explore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ExplorePage {
visit() {
cy.visitWithLogin('/explore');
cy.visit('/explore');
this.wait();
}

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/__tests__/cypress/cypress/pages/modelMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ModelMetricsChart extends Contextual<HTMLTableRowElement> {

class ModelMetricsPerformance extends ModelMetricsGlobal {
visit(project: string, model: string) {
cy.visitWithLogin(`/modelServing/${project}/metrics/${model}/performance`);
cy.visit(`/modelServing/${project}/metrics/${model}/performance`);
this.wait();
}

Expand All @@ -44,7 +44,7 @@ class ModelMetricsPerformance extends ModelMetricsGlobal {

class ModelMetricsBias extends ModelMetricsGlobal {
visit(project: string, model: string, disableA11y = false) {
cy.visitWithLogin(`/modelServing/${project}/metrics/${model}/bias`);
cy.visit(`/modelServing/${project}/metrics/${model}/bias`);

// TODO: disableA11y should be removed once this PF bug is resolved: https://github.com/patternfly/patternfly-react/issues/9968
this.wait(disableA11y);
Expand Down Expand Up @@ -85,7 +85,7 @@ class ModelMetricsBias extends ModelMetricsGlobal {

class ServerMetrics extends ModelMetricsGlobal {
visit(project: string, server: string) {
cy.visitWithLogin(`/projects/${project}/metrics/server/${server}`);
cy.visit(`/projects/${project}/metrics/server/${server}`);
this.wait();
}

Expand All @@ -97,7 +97,7 @@ class ServerMetrics extends ModelMetricsGlobal {

class ModelMetricsConfigureSection {
visit(project: string, model: string) {
cy.visitWithLogin(`/modelServing/${project}/metrics/${model}/configure`);
cy.visit(`/modelServing/${project}/metrics/${model}/configure`);
this.wait();
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/__tests__/cypress/cypress/pages/modelRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { appChrome } from '~/__tests__/cypress/cypress/pages/appChrome';

class ModelRegistry {
landingPage() {
cy.visitWithLogin('/');
cy.visit('/');
this.waitLanding();
}

visit(modelRegistry?: string) {
cy.visitWithLogin(`/modelRegistry${modelRegistry}`);
cy.visit(`/modelRegistry${modelRegistry}`);
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Contextual } from './components/Contextual';

class ModelServingGlobal {
visit(project?: string) {
cy.visitWithLogin(`/modelServing${project ? `/${project}` : ''}`);
cy.visit(`/modelServing${project ? `/${project}` : ''}`);
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class NotebookImageSettingsTableToolbar extends TableToolbar {}

class NotebookImageSettings {
visit() {
cy.visitWithLogin('/notebookImages');
cy.visit('/notebookImages');
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class PageNotFound {
visit(name: string) {
cy.visitWithLogin(`/${name}`);
cy.visit(`/${name}`);
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
class CompareRunsGlobal {
visit(projectName: string, experimentId: string, runIds: string[] = []) {
cy.visitWithLogin(
`/experiments/${projectName}/${experimentId}/compareRuns?runs=${runIds.join(',')}`,
);
cy.visit(`/experiments/${projectName}/${experimentId}/compareRuns?runs=${runIds.join(',')}`);
}

findInvalidRunsError() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TableRow } from '~/__tests__/cypress/cypress/pages/components/table';

class ExperimentsTabs {
visit(namespace?: string, tab?: string) {
cy.visitWithLogin(`/experiments${namespace ? `/${namespace}` : ''}${tab ? `/${tab}` : ''}`);
cy.visit(`/experiments${namespace ? `/${namespace}` : ''}${tab ? `/${tab}` : ''}`);
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TableRow } from '~/__tests__/cypress/cypress/pages/components/table';

class ManageRunsPage {
visit(experimentId: string, projectName: string, runIds: string[]) {
cy.visitWithLogin(
cy.visit(
`/experiments/${projectName}/${experimentId}/compareRuns/add?runs=${runIds.join(',')}`,
);
this.wait();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DeleteModal } from '~/__tests__/cypress/cypress/pages/components/Delete

class PipelineRunsGlobal {
visit(projectName: string, runType?: 'active' | 'archived' | 'scheduled') {
cy.visitWithLogin(
cy.visit(
`/pipelineRuns/${projectName}${
runType ? `?${PipelineRunSearchParam.RunType}=${runType}` : ''
}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DeleteModal } from '~/__tests__/cypress/cypress/pages/components/Delete

class PipelinesGlobal {
visit(projectName: string) {
cy.visitWithLogin(`/pipelines/${projectName}`);
cy.visit(`/pipelines/${projectName}`);
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Contextual } from '~/__tests__/cypress/cypress/pages/components/Context

class PipelinesTopology {
visit(namespace: string, pipelineId: string, pipelineVersionId: string) {
cy.visitWithLogin(`/pipelines/${namespace}/pipeline/view/${pipelineId}/${pipelineVersionId}`);
cy.visit(`/pipelines/${namespace}/pipeline/view/${pipelineId}/${pipelineVersionId}`);
this.wait();
}

Expand Down Expand Up @@ -71,7 +71,7 @@ class DetailsItem extends Contextual<HTMLElement> {

class PipelineDetails extends PipelinesTopology {
visit(namespace: string, pipelineId: string, pipelineVersionId: string) {
cy.visitWithLogin(`/pipelines/${namespace}/pipeline/view/${pipelineId}/${pipelineVersionId}`);
cy.visit(`/pipelines/${namespace}/pipeline/view/${pipelineId}/${pipelineVersionId}`);
this.wait();
}

Expand Down Expand Up @@ -114,7 +114,7 @@ class PipelineDetails extends PipelinesTopology {

class PipelineRunJobDetails extends RunDetails {
visit(namespace: string, pipelineId: string) {
cy.visitWithLogin(`/pipelineRuns/${namespace}/pipelineRunJob/view/${pipelineId}`);
cy.visit(`/pipelineRuns/${namespace}/pipelineRunJob/view/${pipelineId}`);
this.wait();
}

Expand All @@ -129,7 +129,7 @@ class PipelineRunJobDetails extends RunDetails {

class PipelineRunDetails extends RunDetails {
visit(namespace: string, pipelineId: string) {
cy.visitWithLogin(`/pipelineRuns/${namespace}/pipelineRun/view/${pipelineId}`);
cy.visit(`/pipelineRuns/${namespace}/pipelineRun/view/${pipelineId}`);
this.wait();
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/__tests__/cypress/cypress/pages/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ProjectRow extends TableRow {

class ProjectListPage {
visit() {
cy.visitWithLogin('/projects');
cy.visit('/projects');
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ServingRuntimeRow {

class ServingRuntimes {
visit() {
cy.visitWithLogin('/servingRuntimes');
cy.visit('/servingRuntimes');
this.wait();
}

Expand Down

0 comments on commit 91a5d00

Please sign in to comment.