[Flaky #135251] Unskip test (#164718)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Alejandro Fernández Haro 2023-08-28 09:55:29 +02:00 committed by GitHub
parent 6e3bd4859f
commit ba61ac0366
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 6 deletions

View file

@ -7,8 +7,9 @@
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }) {
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
const globalNav = getService('globalNav');
const testSubjects = getService('testSubjects');

View file

@ -13,8 +13,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const globalNav = getService('globalNav');
const PageObjects = getPageObjects(['newsfeed', 'common']);
// FLAKY: https://github.com/elastic/kibana/issues/135251
describe.skip('Newsfeed', () => {
describe('Newsfeed', () => {
before(async () => {
await PageObjects.newsfeed.resetPage();
});

View file

@ -6,7 +6,9 @@
* Side Public License, v 1.
*/
export default function ({ getService, loadTestFile }) {
import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, loadTestFile }: FtrProviderContext) {
const browser = getService('browser');
describe('home app', function () {

View file

@ -109,6 +109,18 @@ export class CommonPageObject extends FtrService {
? await this.loginIfPrompted(appUrl, insertTimestamp, disableWelcomePrompt)
: await this.browser.getCurrentUrl();
if (
currentUrl.includes('/app/home') &&
disableWelcomePrompt &&
(await this.isWelcomeScreen())
) {
await this.browser.setLocalStorageItem('home:welcome:show', 'false');
// Force a new navigation again
const msg = `Found the Welcome page in ${currentUrl}. Skipping it...`;
this.log.debug(msg);
throw new Error(msg);
}
if (ensureCurrentUrl && !currentUrl.includes(appUrl)) {
throw new Error(`expected ${currentUrl}.includes(${appUrl})`);
}
@ -274,7 +286,7 @@ export class CommonPageObject extends FtrService {
appName === 'home' &&
currentUrl.includes('app/home') &&
disableWelcomePrompt &&
(await this.isChromeHidden())
(await this.isWelcomeScreen())
) {
await this.browser.setLocalStorageItem('home:welcome:show', 'false');
const msg = `Failed to skip the Welcome page when navigating the app ${appName}`;
@ -505,6 +517,10 @@ export class CommonPageObject extends FtrService {
}
}
async isWelcomeScreen() {
return await this.testSubjects.exists('homeWelcomeInterstitial');
}
/**
* Get visible text of the Welcome Banner
*/

View file

@ -21,7 +21,7 @@ export class NewsfeedPageObject extends FtrService {
}
async resetPage() {
await this.common.navigateToUrl('home', undefined); // navigateToApp sets `disableWelcomePrompt` to true under the hood. `navigateToUrl` explicitly disables the welcome screen.
await this.common.navigateToApp('home');
}
async closeNewsfeedPanel() {