-
Notifications
You must be signed in to change notification settings - Fork 947
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: sitbubu <[email protected]>
- Loading branch information
1 parent
d5baf73
commit 9f0c57b
Showing
6 changed files
with
67 additions
and
2 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
40 changes: 40 additions & 0 deletions
40
test/plugin_functional/test_suites/doc_views_links/doc_views_links.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,40 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import expect from '@osd/expect'; | ||
import { PluginFunctionalProviderContext } from '../../services'; | ||
|
||
export default function ({ getService, getPageObjects }: PluginFunctionalProviderContext) { | ||
const testSubjects = getService('testSubjects'); | ||
const find = getService('find'); | ||
const browser = getService('browser'); | ||
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']); | ||
|
||
describe('custom doc views links', function () { | ||
beforeEach(async () => { | ||
await PageObjects.common.navigateToApp('discover'); | ||
await PageObjects.timePicker.setDefaultAbsoluteRange(); | ||
await testSubjects.click('docTableExpandToggleColumn'); | ||
}); | ||
|
||
it('should show href doc views link', async () => { | ||
const hrefLink = await find.byLinkText('href doc view link'); | ||
await find.byLinkText('generateUrlFn doc view link'); | ||
expect(await hrefLink.isDisplayed()).to.be(true); | ||
}); | ||
|
||
it('should render href doc view link', async () => { | ||
const hrefLink = await find.byLinkText('href doc view link'); | ||
await hrefLink.click(); | ||
expect(await browser.getCurrentUrl()).to.eql('http://some-url/'); | ||
}); | ||
|
||
it('should render react doc view', async () => { | ||
const generateUrlFnLink = await find.byLinkText('generateUrlFn doc view link'); | ||
await generateUrlFnLink.click(); | ||
expect(await browser.getCurrentUrl()).to.eql('http://some-url/'); | ||
}); | ||
}); | ||
} |
18 changes: 18 additions & 0 deletions
18
test/plugin_functional/test_suites/doc_views_links/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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { PluginFunctionalProviderContext } from '../../services'; | ||
|
||
export default function ({ getService, loadTestFile }: PluginFunctionalProviderContext) { | ||
const opensearchArchiver = getService('opensearchArchiver'); | ||
|
||
describe('doc views links', function () { | ||
before(async () => { | ||
await opensearchArchiver.loadIfNeeded('../functional/fixtures/opensearch_archiver/discover'); | ||
}); | ||
|
||
loadTestFile(require.resolve('./doc_views_links')); | ||
}); | ||
} |