-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Observability Onboarding] Migrate e2e Playwright tests from oblt-playwright repo #203616
[Observability Onboarding] Migrate e2e Playwright tests from oblt-playwright repo #203616
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
Hey, thanks for this! I tested both auto-detect and k8s flows and the while the auto-detect one was working fine, the kubernetes one opened the table flyout for the nodes visualization to early and it was still empty. Refreshing the page and opening the flyout manually made the test pass, I guess we need a similar retry loop here like the one you added for auto-detect and the host overview page? Other than that LGTM |
2a97c3c
to
3c5ab27
Compare
@flash1293 thank you for testing! I've added a retry logic to the k8s test, please take a look |
341c705
to
ea353e6
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, didn't test again but the change looks like what I had in mind
b7f2c14
to
dec550d
Compare
dec550d
to
de469e9
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.
packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts
changes LGTM
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.
Left some questions.
testDir: './', | ||
outputDir: './.playwright', | ||
/* Run tests in files in parallel */ | ||
fullyParallel: true, |
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 see you'd like it to be fully parallel, which I believe is at the worker scope.
Is it ok that below workers is set to 1
?
I guess I'm thinking how can it be fully parallel with one worker.
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.
Good point! Tbh, I did not write this config in the first place (migrated from the oblt-playwright
repo), but I see this is the recommended basic config from the Playwright docs. I think it makes sense though in our use case, because tests are run both on the CI and locally, so there will be a single worker for the CI (AFAIK the instance running it does not have a lot of resources) and locally it will be the default value, which probably calculated depending on CPU cores count.
testIdAttribute: 'data-test-subj', | ||
video: { | ||
mode: 'off', | ||
size: { width: 1920, height: 1200 }, |
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.
Do we need a size if this config is turned off?
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.
True, we don't need it, will remove the whole video
block as it's off
by default anyway
if (isAuthenticated) { | ||
await page.context().storageState({ path: STORAGE_STATE }); | ||
} else if (spaceSelector) { | ||
await page.locator('xpath=//a[contains(text(),"Default")]').click(); |
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 use an xpath locator if you've already added data-test-subj as the test id for the framework?
} | ||
|
||
public readonly helpMenuButton = () => | ||
this.page.locator('xpath=//div[@data-test-subj="helpMenuButton"]'); |
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.
Basically the same question as before, why use xpath? I could be wrong but I recall it being rather slow in the past and we've got a ton of issues with resources in testing.
|
||
private readonly useCaseKubernetes = () => | ||
this.page.locator( | ||
'xpath=//div[@data-test-subj="observabilityOnboardingUseCaseCard-kubernetes"]//input[@type="radio"]' |
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 know, I just realized that our Team's POC is the only place I know of in the repo that has a playwright-data-test-subj integration.
Here it is.
In this case the kbn/scout package does not override playwrights test id attr, but this test subj functionality is exposed.
Maybe this is useful for you all?
\cc @dmlemeshko
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.
Those are good points about using xpath
, I left them as they were originally written in the oblt-playwright repo, but it 100% makes sense to just use test id helper and narrow down using Locator's methods, I'll re-write those selector
…aywright Update to the latest tests Ignore playwright test results Fix output directory Temporarily move playwright config to the root of the repo Enable screenshots Add Kubernetes EA test Reduce timeout for debugging
1ad6ae2
to
43fbac1
Compare
/oblt-deploy |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
…ywright repo (elastic#203616) Closes elastic#199016 This change migrates and and expands tests from [oblt-playwright](https://github.com/elastic/oblt-playwright) repo. These tests are part of the [Nightly workflow](https://github.com/elastic/ensemble/actions/workflows/nightly.yml) and being run by an Ensemble story on the CI. The Nightly workflow itself is still in development and does not support some of the use cases, that's why kubernetes tests are skipped for now in this PR. See the `./README.md` on how to run the tests locally. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes #199016
This change migrates and and expands tests from oblt-playwright repo.
These tests are part of the Nightly workflow and being run by an Ensemble story on the CI.
The Nightly workflow itself is still in development and does not support some of the use cases, that's why kubernetes tests are skipped for now in this PR.
See the
./README.md
on how to run the tests locally.