-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
153 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getPageObjects, getService }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['common']); | ||
const browser = getService('browser'); | ||
const log = getService('log'); | ||
const testSubjects = getService('testSubjects'); | ||
const retry = getService('retry'); | ||
|
||
describe('Short URLs', () => { | ||
it('opening a missing short URL shows empty prompt', async () => { | ||
await PageObjects.common.navigateToApp('home'); | ||
|
||
log.info('Navigating to Home...'); | ||
await retry.try(async () => { | ||
const title = await browser.getTitle(); | ||
expect(title).to.be('Home - Elastic'); | ||
}); | ||
|
||
log.info('Changing URL to missing short URL...'); | ||
const currentUrl = await browser.getCurrentUrl(); | ||
const newUrl = currentUrl.replace(/\/app\/home/, '/app/r/s/foofoo'); | ||
await browser.get(newUrl); | ||
|
||
await retry.try(async () => { | ||
await testSubjects.existOrFail('redirectErrorEmptyPromptBody'); | ||
}); | ||
|
||
log.info('Clicking the prompt button...'); | ||
await testSubjects.click('redirectErrorEmptyPromptButton'); | ||
|
||
await retry.try(async () => { | ||
const title = await browser.getTitle(); | ||
expect(title).to.be('Home - Elastic'); | ||
}); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { FtrConfigProviderContext } from '@kbn/test'; | ||
|
||
export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
const functionalConfig = await readConfigFile(require.resolve('../../config.base.js')); | ||
|
||
return { | ||
...functionalConfig.getAll(), | ||
testFiles: [require.resolve('.')], | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile }: FtrProviderContext) { | ||
describe('Sharing features', () => { | ||
loadTestFile(require.resolve('./_short_urls')); | ||
}); | ||
} |
46 changes: 46 additions & 0 deletions
46
x-pack/test_serverless/functional/test_suites/common/sharing/_short_urls.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getPageObjects, getService }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['common']); | ||
const browser = getService('browser'); | ||
const log = getService('log'); | ||
const testSubjects = getService('testSubjects'); | ||
const retry = getService('retry'); | ||
|
||
describe('Short URLs', () => { | ||
it('opening a missing short URL shows empty prompt', async () => { | ||
await PageObjects.common.navigateToApp('home'); | ||
|
||
log.info('Navigating to Home...'); | ||
await retry.try(async () => { | ||
const title = await browser.getTitle(); | ||
expect(title).to.be('Home - Elastic'); | ||
}); | ||
|
||
log.info('Changing URL to missing short URL...'); | ||
const currentUrl = await browser.getCurrentUrl(); | ||
const newUrl = currentUrl.replace(/\/app\/home/, '/app/r/s/foofoo'); | ||
await browser.get(newUrl); | ||
|
||
await retry.try(async () => { | ||
await testSubjects.existOrFail('redirectErrorEmptyPromptBody'); | ||
}); | ||
|
||
log.info('Clicking the prompt button...'); | ||
await testSubjects.click('redirectErrorEmptyPromptButton'); | ||
|
||
await retry.try(async () => { | ||
const title = await browser.getTitle(); | ||
expect(title).to.be('Home - Elastic'); | ||
}); | ||
}); | ||
}); | ||
} |
14 changes: 14 additions & 0 deletions
14
x-pack/test_serverless/functional/test_suites/common/sharing/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default ({ loadTestFile }: FtrProviderContext) => { | ||
describe('Sharing features', function () { | ||
loadTestFile(require.resolve('./_short_urls')); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters