-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[D&D] Initial functional tests (#2070)
* fix: searchable dropdown Signed-off-by: Ashwin Pc <ashwinpc@amazon.com> * fix: broken empty test Signed-off-by: Ashwin Pc <ashwinpc@amazon.com> * test(FTR): Adds basic functional tests for D&D Signed-off-by: Ashwin Pc <ashwinpc@amazon.com> * test(FTR): Adds CI group 13 to test workflow Signed-off-by: Ashwin Pc <ashwinpc@amazon.com> * fix: nit fixes Signed-off-by: Ashwin Pc <ashwinpc@amazon.com> * chore: att test to jenkinsfile Signed-off-by: Ashwin Pc <ashwinpc@amazon.com> * chore: minor nit fixes Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
- Loading branch information
Showing
19 changed files
with
325 additions
and
33 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
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
6 changes: 0 additions & 6 deletions
6
src/plugins/wizard/public/visualizations/metric/to_expression.test.ts
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import expect from '@osd/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['visualize', 'wizard']); | ||
const log = getService('log'); | ||
const retry = getService('retry'); | ||
|
||
describe('Basic tests for wizard app ', function () { | ||
before(async () => { | ||
log.debug('navigateToApp wizard'); | ||
await PageObjects.wizard.navigateToCreateWizard(); | ||
}); | ||
|
||
it('should be able to switch data sources', async () => { | ||
const dataSourceValue = await PageObjects.wizard.selectDataSource( | ||
PageObjects.wizard.index.LOGSTASH_NON_TIME_BASED | ||
); | ||
|
||
expect(dataSourceValue).to.equal(PageObjects.wizard.index.LOGSTASH_NON_TIME_BASED); | ||
// TODO: Switch with a datasource with unique fields to test if it exists | ||
}); | ||
|
||
it('should show visualization when a field is added', async () => { | ||
await PageObjects.wizard.addField('metric', 'Average', 'machine.ram'); | ||
const avgMachineRam = ['13,104,036,080.615', 'Average machine.ram']; | ||
|
||
await retry.try(async function tryingForTime() { | ||
const metricValue = await PageObjects.wizard.getMetric(); | ||
expect(avgMachineRam).to.eql(metricValue); | ||
}); | ||
}); | ||
|
||
it('should clear visualization when field is deleted', async () => { | ||
await PageObjects.wizard.removeField('metric', 0); | ||
|
||
await retry.try(async function tryingForTime() { | ||
const isEmptyWorkspace = await PageObjects.wizard.isEmptyWorkspace(); | ||
expect(isEmptyWorkspace).to.be(true); | ||
}); | ||
}); | ||
}); | ||
} |
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,51 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import expect from '@osd/expect'; | ||
import { VISUALIZE_ENABLE_LABS_SETTING } from '../../../../src/plugins/visualizations/common/constants'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['visualize', 'wizard']); | ||
const log = getService('log'); | ||
const opensearchDashboardsServer = getService('opensearchDashboardsServer'); | ||
|
||
describe('experimental settings for wizard app ', function () { | ||
it('should show an notification when creating wizard visualization', async () => { | ||
log.debug('navigateToApp visualize'); | ||
await PageObjects.visualize.navigateToNewVisualization(); | ||
await PageObjects.visualize.waitForVisualizationSelectPage(); | ||
|
||
// Try to find the wizard Vis type. | ||
const wizardVisTypeExists = await PageObjects.visualize.hasVisType('wizard'); | ||
expect(wizardVisTypeExists).to.be(true); | ||
|
||
// Create a new visualization | ||
await PageObjects.visualize.clickVisType('wizard'); | ||
|
||
// Check that the experimental banner is there and state that this is experimental | ||
const info = await PageObjects.wizard.getExperimentalInfo(); | ||
expect(await info.getVisibleText()).to.contain('experimental'); | ||
}); | ||
|
||
it('should not be available in the picker when disabled', async () => { | ||
log.debug('navigateToApp visualize'); | ||
await opensearchDashboardsServer.uiSettings.replace({ | ||
[VISUALIZE_ENABLE_LABS_SETTING]: false, | ||
}); | ||
await PageObjects.visualize.navigateToNewVisualization(); | ||
await PageObjects.visualize.waitForVisualizationSelectPage(); | ||
|
||
// Try to find the wizard Vis type. | ||
const wizardVisTypeExists = await PageObjects.visualize.hasVisType('wizard'); | ||
expect(wizardVisTypeExists).to.be(false); | ||
}); | ||
|
||
after(async () => { | ||
// unset the experimental ui setting | ||
await opensearchDashboardsServer.uiSettings.unset(VISUALIZE_ENABLE_LABS_SETTING); | ||
}); | ||
}); | ||
} |
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,39 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context.d'; | ||
import { UI_SETTINGS } from '../../../../src/plugins/data/common'; | ||
|
||
export default function ({ getService, loadTestFile }: FtrProviderContext) { | ||
const browser = getService('browser'); | ||
const log = getService('log'); | ||
const opensearchArchiver = getService('opensearchArchiver'); | ||
const opensearchDashboardsServer = getService('opensearchDashboardsServer'); | ||
|
||
describe('wizard app', function () { | ||
this.tags('ciGroup13'); | ||
|
||
before(async function () { | ||
log.debug('Starting wizard before method'); | ||
await browser.setWindowSize(1280, 800); | ||
await opensearchArchiver.loadIfNeeded('logstash_functional'); | ||
await opensearchArchiver.loadIfNeeded('long_window_logstash'); | ||
await opensearchArchiver.loadIfNeeded('visualize'); | ||
await opensearchDashboardsServer.uiSettings.replace({ | ||
defaultIndex: 'logstash-*', | ||
[UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', | ||
}); | ||
}); | ||
|
||
after(async () => { | ||
await opensearchArchiver.unload('logstash_functional'); | ||
await opensearchArchiver.unload('long_window_logstash'); | ||
await opensearchArchiver.unload('visualize'); | ||
}); | ||
|
||
loadTestFile(require.resolve('./_base')); | ||
loadTestFile(require.resolve('./_experimental_vis')); | ||
}); | ||
} |
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
Oops, something went wrong.