Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONSOLE-2478: Cypress Annotations tests #7448

Merged

Conversation

dtaylor113
Copy link
Contributor

@dtaylor113 dtaylor113 commented Dec 7, 2020

image

Also removes annotations test from Protractor

CONSOLE-2478

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dtaylor113, happy to see these tests updated!

@spadgett
Copy link
Member

spadgett commented Dec 7, 2020

/assign

@dtaylor113
Copy link
Contributor Author

/retest

@dtaylor113 dtaylor113 changed the title Cypress annotations test Cypress Annotations tests Dec 8, 2020
@dtaylor113
Copy link
Contributor Author

/test all

export const annotationRowsKey = $$('[placeholder="Key"]');
export const annotationRowsValue = $$('[placeholder="Value"]');
export const annotationRowsDelete = $$('[data-test-id="pairs-list__delete-btn"]');
import { $ } from 'protractor';
export const annotationDialogOverlay = $('.co-overlay');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we generalize this and put it in a different file if it's the only thing left? We should always have the same selector for a dialog overlay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

cy.byTestID('pairs-list-value').type(value);
});
};
/* const clearName = (row: JQuery<HTMLElement>) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove commented out code if not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

};

const getNameValueEditorRow = (row: number) => {
return cy.byTestID('pairs-list-row').eq(row - 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unclear why we're using row - 1 here. Is this a 0-based index vs. 1-based index?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines +33 to +42
const setName = (row: JQuery<HTMLElement>, nameValue: string) => {
cy.wrap(row).within(() => {
cy.byTestID('pairs-list-name').type(nameValue);
});
};
const setValue = (row: JQuery<HTMLElement>, value: string) => {
cy.wrap(row).within(() => {
cy.byTestID('pairs-list-value').type(value);
});
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this API looks a lot cleaner!

@dtaylor113 dtaylor113 force-pushed the cypress-annotations-test branch 2 times, most recently from 485b224 to 90a5dde Compare December 8, 2020 21:23
@@ -24,6 +23,7 @@ import { CloneVirtualMachineDialog } from '../dialogs/cloneVirtualMachineDialog'
import { getRandStr } from '../utils/utils';

const noConfirmDialogActions: VM_ACTION[] = [VM_ACTION.Start, VM_ACTION.Clone];
const annotationDialogOverlay = $('.co-overlay');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go in a view file somewhere and should be generalized to modalOverlay.

Copy link
Contributor Author

@dtaylor113 dtaylor113 Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. kubevirt-plugin/integration-tests/.../virtualMachine.ts was the only Protractor code using annotationDialogOverlay from the deleted file frontend/integration-tests/views/modal-annotations.view.ts. Added export const modalOverlay = $('.co-overlay') to common kubevirt-plugin view file which has other modal/dialog consts.

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 9, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dtaylor113, spadgett

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 9, 2020
@dtaylor113
Copy link
Contributor Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit 7fdc2eb into openshift:master Dec 9, 2020
@spadgett spadgett changed the title Cypress Annotations tests CONSOLE-2478: Cypress Annotations tests Dec 10, 2020
@spadgett spadgett added this to the v4.7 milestone Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/dev-console Related to dev-console component/kubevirt Related to kubevirt-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants