-
Notifications
You must be signed in to change notification settings - Fork 261
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
Vue3 fix workload storage #12070
Vue3 fix workload storage #12070
Changes from all commits
80b6a14
4a43ceb
bcb325c
dff077a
29bbedd
1d2bc82
69a9200
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import LabeledSelectPo from '@/cypress/e2e/po/components/labeled-select.po'; | ||
|
||
export default class ButtonDropdownPo extends LabeledSelectPo { | ||
toggle() { | ||
return this.self().find('[data-testid="dropdown-button"]').click(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ export default class TabbedPo extends ComponentPo { | |
} | ||
|
||
clickTabWithSelector(selector: string) { | ||
return this.self().get(`${ selector }`).click(); | ||
return this.self().find(`${ selector }`).click(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switching from |
||
} | ||
|
||
allTabs() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import ComponentPo from '@/cypress/e2e/po/components/component.po'; | ||
import ButtonDropdownPo from '@/cypress/e2e/po/components/button-dropdown.po'; | ||
import InputPo from '@/cypress/e2e/po/components/input.po'; | ||
|
||
class ContainerMountPo extends ComponentPo { | ||
constructor(selector = '.dashboard-root') { | ||
super(selector); | ||
} | ||
|
||
nthMountPoint(i: number) { | ||
return new InputPo(`[data-testid="mount-path-${ i }"] input:first-child`); | ||
} | ||
} | ||
|
||
export default class ContainerMountPathPo extends ComponentPo { | ||
constructor(selector = '.dashboard-root') { | ||
super(selector); | ||
} | ||
|
||
addVolumeButton() : ButtonDropdownPo { | ||
// return this.self().find('[data-testid="container-storage-add-button"]'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aside from this dead code, everything lgtm from e2e test perspective |
||
return new ButtonDropdownPo('[data-testid="container-storage-add-button"]'); | ||
} | ||
|
||
addVolume(label: string) { | ||
this.addVolumeButton().toggle(); | ||
this.addVolumeButton().clickOptionWithLabel(label); | ||
} | ||
|
||
nthVolumeMount(i: number): ContainerMountPo { | ||
return new ContainerMountPo(`[data-testid="container-storage-mount-${ i }"]`); | ||
} | ||
|
||
removeVolume(i: number) { | ||
this.self().find(`[data-testid="container-storage-array-list"] [data-testid="remove-item-${ i }"]`).click(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import ComponentPo from '@/cypress/e2e/po/components/component.po'; | ||
import CodeMirrorPo from '@/cypress/e2e/po/components/code-mirror.po'; | ||
|
||
class WorkloadVolumePo extends ComponentPo { | ||
yamlEditor(): CodeMirrorPo { | ||
return CodeMirrorPo.bySelector(this.self(), '[data-testid="yaml-editor-code-mirror"]'); | ||
} | ||
} | ||
|
||
export default class WorkloadPodStoragePo extends ComponentPo { | ||
constructor(selector = '.dashboard-root') { | ||
super(selector); | ||
} | ||
|
||
nthVolumeComponent(n: number) { | ||
return new WorkloadVolumePo(`[data-testid="volume-component-${ n }"]`); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import CodeMirrorPo from '@/cypress/e2e/po/components/code-mirror.po'; | ||
import ComponentPo from '@/cypress/e2e/po/components/component.po'; | ||
|
||
export default class YamlEditorPo extends ComponentPo { | ||
input(): CodeMirrorPo { | ||
return CodeMirrorPo.bySelector(this.self(), '[data-testid="yaml-editor-code-mirror"]'); | ||
} | ||
} |
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 caused issues for me when running tests locally because it'd match any dropdown option containing the label provided, eg
clickLabel('default')
might select an option labeledcluster-fleet-default-c-9jtrc-35cc406cb29a
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.
Was it only happening locally? if so, any idea why? I think I may have run into something similar.
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've only seen it locally, I'm guessing when the test runs in ci there aren't other namespaces containing
default
available. There are probably other po methods that are using .contains without a regular expression and brittle in the same way though.