-
Notifications
You must be signed in to change notification settings - Fork 266
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
Add kubewarden spec to extension compatibility tests #11668
base: master
Are you sure you want to change the base?
Conversation
a4c688d
to
97aaa24
Compare
@richard-cox @jordojordo the usual cleanup is still needed because I wanted to demonstrate that the spec is working just fine. @jordojordo I think we've covered what we discussed in terms of meaningful tests, right?
|
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.
general approach looks good. there's a few POs that could wrap some existing. we might want to spin out some of the custom POs from the utils file at some point (if it grows)
super(ProjectNamespaceDetailPagePo.createPath(clusterId, id)); | ||
} | ||
|
||
clickComplianceTab() { |
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.
these two are specific to kw
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 created a new class in kubewarden.utils called KubewardenResourceComplianceReportPagePo
which is the same for any resource, afaik, and then imported it in projectNamespaceDetail
to be exposed as kubewardenComplianceReport
, which will access the methods.
I think the context is correct, to keep it accessible in projectsNamespaces, but the "ownership" I think you are right. What do you think?
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.
The aim is to keep kubewarden specific code out of generic code.
I might be wrong, but if the compliance tab is an kw specific additional tab in the detail page of a project. so suggest the hierarchy as
KubewardenResourceComplianceReportTabPo extends ComponentPo {
complianceSortableTable() {
return new SortableTablePo(this.self().get('#policy-report-tab .sortable-table'));
}
}
KubewardenProjectNamespaceDetailPagePo extends ProjectNamespaceDetailPagePo {
clickComplianceTab() {
return new TabbedPo().clickTabWithSelector('[data-testid="btn-policy-report-tab"]');
}
complianceTab() {
return new KubewardenResourceComplianceReportTabPo(this.self())
}
}
So there's a KW specific project namespace detail page, inheriting all the root page functionality, exposing new KW specific functionality
@richard-cox did a few changes based on your comments, but since it generally looks good, tomorrow I am going to base my work on neuvector spec on this PR. Thank you for your time looking into this! 🙏 |
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 - small comment about the naming scheme, and I think those gates are ready to be removed.
… the utils files + comment unwanted workflow runs
…e report test in KW spec + add KW spec as a runner in the PR workflow + temporary comment slack messaging on PR as it throws error because of secret
8c21d28
to
d5db1c2
Compare
super(ProjectNamespaceDetailPagePo.createPath(clusterId, id)); | ||
} | ||
|
||
kubewardenComplianceReport() { |
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 would be rmeoved as part of #11668 (comment)
|
||
successfulCountCheck(countExpected: number, timeout = 15000) { | ||
// let's give it a buffer for the job to finish running | ||
cy.wait(timeout); // eslint-disable-line cypress/no-unnecessary-waiting |
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.
you should be able to extend the time get
allows for an element to appear by passing in args to cy.get (check out usages of MEDIUM_TIMEOUT_OPT, LONG_TIMEOUT_OPT, EXTRA_LONG_TIMEOUT_OPT)
expect(response?.body.metadata).to.have.property('namespace', namespaceToCheck); | ||
} | ||
|
||
cy.wait(5000); // eslint-disable-line cypress/no-unnecessary-waiting |
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.
why is there a 5 second wait here?
// let's give it a buffer for the job to finish running | ||
cy.wait(timeout); // eslint-disable-line cypress/no-unnecessary-waiting | ||
|
||
return cy.get('.gauges__pods div:nth-child(1) div h1').invoke('text').should('contain', countExpected); |
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.
Feels like this should be a CountGauge PO
expect(response?.statusCode).to.eq(201); | ||
expect(response?.body.metadata).to.have.property('name', nameToCheck); | ||
|
||
cy.wait(5000); // eslint-disable-line cypress/no-unnecessary-waiting |
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.
why's there a wait here?
|
||
extensionsPo.addExtensionsRepositoryDirectLink(EXTENSION_REPO, EXTENSION_BRANCH, EXTENSION_CLUSTER_REPO_NAME, true); | ||
// let's wait a bit so that the repo is available in extensions screen | ||
cy.wait(10000); // eslint-disable-line cypress/no-unnecessary-waiting |
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 be achievable with a should
or get with timeout
kubewardenPo.chartInstallPage().waitForChartPage('rancher-charts', 'rancher-monitoring'); | ||
// monitoring chart install page takes a bit to come up. The search for "rancherMonitoringInstallIntoProjectSelect" | ||
// might fail because of this. Let's give it a time buffer here | ||
cy.wait(10000); // eslint-disable-line cypress/no-unnecessary-waiting |
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.
there should be other ways to check for screen content is available, applies to all the cy.wait(10000)'s on page
Summary
Fixes #11482
Fixes #9232
Occurred changes and/or fixed issues
Kubewarden
e2e extension compatibility testsTechnical notes summary
Based on the work done in #11626, which needed a profound rebase from
master
which spawned this new PR.Areas or cases that should be tested
Areas which could experience regressions
Screenshot/Video
Checklist