-
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
[page_objects/common_page] convert to ts #50771
Conversation
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
private async loginIfPrompted(appUrl: string) { | ||
let currentUrl = await browser.getCurrentUrl(); | ||
log.debug(`currentUrl = ${currentUrl}\n appUrl = ${appUrl}`); | ||
await find.byCssSelector('[data-test-subj="kibanaChrome"]', 6 * defaultFindTimeout); // 60 sec 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.
I decreased timeout from 4 min to 1 min because it makes sense to fail and retry from scratch with url navigation rather than wait so long for the page to be loaded
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.
Curious, why private?
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.
Well, it is used only in the same class as a helper function. For the tests we expose navigation functions, e.g. navigateToApp
and use { shouldLoginIfPrompted: boolean }
to manage login. I'm open to change it, but not sure we want it to be used directly
}); | ||
} | ||
|
||
log.debug('navigating to ' + appName + ' url: ' + appUrl); | ||
|
||
function navigateTo(url) { | ||
return retry.try(function () { | ||
await retry.tryForTime(defaultTryTimeout * 2, async () => { |
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 decreased retry timeout from 6 min to 4 min since it should be fairly enough time for navigation + login, in case of failure we should get a screenshot with stack trace instead of mocha timeout
// since we're using hash URLs, always reload first to force re-render | ||
return kibanaServer.uiSettings.getDefaultIndex() |
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 removed this line since we didn't use the return result. Not sure what was the purpose?
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 was code here at one time that checked if the default index was set when we tried to navigate to Discover, Visualize, Dashboard (but not Management). If you didn't have it set, it would set it to logstash-*
and log a warning message. Maybe we fixed any tests which weren't setting the default index, in which case that code isn't needed any more.
|
||
if (!navSuccessful) { | ||
const msg = | ||
'App failed to load: ' + |
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 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.
A template literal would make this much more readable.
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.
Agree, I will fix it :)
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 in a362ca3
💚 Build Succeeded |
retest |
💚 Build Succeeded |
retest |
💚 Build Succeeded |
@elasticmachine merge upstream |
💚 Build Succeeded |
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.
Changes LGTM in the perspective of the operations team code owners files
// Browsers don't show the ':port' if it's 80 or 443 so we have to | ||
// remove that part so we can get a match in the tests. | ||
const navSuccessful = new RegExp( | ||
appUrl.replace(':80/', '/').replace(':443/', '/') + |
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.
Could be shorter (just less code to read)
appUrl.replace(':80/', '/').replace(':443/', '/') + | |
appUrl.replace(/:80\/|:443\//, '/') + |
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.
@dmlemeshko If you have to re-push, maybe this suggestion is useful.
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.
Cool @wayneseymour, I didn't notice it. I will push next time :)
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
* [page_objects/common_page] convert to ts * fix lint errors * descrease navigation timeouts * use template literal for log messages
* [page_objects/common_page] convert to ts * fix lint errors * descrease navigation timeouts * use template literal for log messages
…-fallback * 'master' of github.com:elastic/kibana: (116 commits) [Maps] move apply global filter settting from layer to source (elastic#50523) [SIEM] Fix: Empty `Source` / `Destination` shown when only ports are populated (elastic#50843) [Maps] Delay vector tile layer syncing until spritesheet is loaded (elastic#48955) [Maps] prevent users from overflowing URL when filtering by shape (elastic#50747) [DOCS] Mark Beats central management as discontinued (elastic#49423) [page_objects/common_page] convert to ts (elastic#50771) [NP Kibana Migrations ] kibana plugin home (elastic#50444) [DOCS] Shareables naming convention (elastic#50497) [ML] DF Analytics - auto-populate model_memory_limit (elastic#50714) Increase alerting test stability and reduce flakiness (elastic#50246) [ML] Remaning new_job_new folder (elastic#50917) [Telemetry] Show opt-in changes for OSS users (elastic#50831) [ML] Fix lat_long anomalies table links menu and value formatting (elastic#50916) [Dev] Fix serialising a really big string (elastic#50915) Better explanation about the Prettier recommendation (extension vs. NPM module) (elastic#50629) [Monitoring] Use a basic monitoring user for tests (elastic#47865) [Monitoring] Gracefully handle issue with filebeat indices (elastic#48929) [Monitoring] Improve permissions required around setup mode (elastic#50421) Additional validation for elasticsearch username (elastic#48247) Revert changes to use_kibana_ui_setting (elastic#50877) ... # Conflicts: # src/legacy/core_plugins/console/server/request.test.ts
Summary
Covert
common_page.js
to ts and simplify the logicChecklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers