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
CONSOLE-2478: Cypress Annotations tests #7448
Conversation
32e701f
to
46651ef
Compare
There was a problem hiding this 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!
frontend/packages/integration-tests-cypress/tests/crud/annotations.spec.ts
Outdated
Show resolved
Hide resolved
frontend/packages/integration-tests-cypress/tests/crud/annotations.spec.ts
Outdated
Show resolved
Hide resolved
frontend/packages/integration-tests-cypress/tests/crud/annotations.spec.ts
Outdated
Show resolved
Hide resolved
/assign |
46651ef
to
7106919
Compare
7106919
to
4503d19
Compare
/retest |
/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'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>) => { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
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); | ||
}); | ||
}; |
There was a problem hiding this comment.
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!
485b224
to
90a5dde
Compare
@@ -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'); |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
90a5dde
to
f083a49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[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 |
/retest |
Also removes annotations test from Protractor
CONSOLE-2478