-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
e82c94f
commit 90820a5
Showing
11 changed files
with
188 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export default function ({ loadTestFile }) { | ||
describe('rollup job', function () { | ||
this.tags('ciGroup1'); | ||
|
||
loadTestFile(require.resolve('./rollup_jobs')); | ||
}); | ||
} |
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,68 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from 'expect.js'; | ||
import { indexBy } from 'lodash'; | ||
|
||
export default function ({ getService, getPageObjects }) { | ||
const esArchiver = getService('esArchiver'); | ||
const log = getService('log'); | ||
const PageObjects = getPageObjects(['security', 'rollup', 'common', 'header']); | ||
|
||
describe('rollup job', async () => { | ||
before(async () => { | ||
// init data | ||
await Promise.all([ | ||
esArchiver.loadIfNeeded('logstash_functional'), | ||
esArchiver.load('canvas/default'), | ||
]); | ||
await PageObjects.common.navigateToApp('rollupJob'); | ||
}); | ||
|
||
after(async () => await esArchiver.unload('logstash_functional')); | ||
|
||
it('create and save a new job', async () => { | ||
const jobName = 'Testjob1'; | ||
const indexPattern = '.kibana*'; | ||
const indexName = 'rollup_index'; | ||
const interval = '1000ms'; | ||
|
||
await PageObjects.rollup.createNewRollUpJob(); | ||
await PageObjects.rollup.verifyStepIsActive(1); | ||
await PageObjects.rollup.addRoleNameandIndexPattern(jobName, indexPattern); | ||
await PageObjects.rollup.verifyIndexPatternAccepted(); | ||
await PageObjects.rollup.setIndexName(indexName); | ||
await PageObjects.rollup.moveToNextStep(); | ||
|
||
//now navigate to histogram | ||
await PageObjects.rollup.verifyStepIsActive(2); | ||
await PageObjects.rollup.setJobInterval(interval); | ||
await PageObjects.rollup.moveToNextStep(); | ||
|
||
//Terms (optional) | ||
await PageObjects.rollup.verifyStepIsActive(3); | ||
await PageObjects.rollup.moveToNextStep(); | ||
|
||
//Histogram(optional) | ||
await PageObjects.rollup.verifyStepIsActive(4); | ||
await PageObjects.rollup.moveToNextStep(); | ||
|
||
//Metrics(optional) | ||
await PageObjects.rollup.verifyStepIsActive(5); | ||
await PageObjects.rollup.moveToNextStep(); | ||
|
||
//saveJob and verify the name in the list | ||
await PageObjects.rollup.verifyStepIsActive(6); | ||
await PageObjects.rollup.saveJob(); | ||
|
||
// verify jobListTitle | ||
const jobList = indexBy(await PageObjects.rollup.getJobList(), 'jobName'); | ||
log.debug(JSON.stringify(jobList)); | ||
log.debug(Object.keys(jobList)); | ||
expect(Object.keys(jobList)).to.have.length(1); | ||
}); | ||
}); | ||
} |
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,82 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from 'expect.js'; | ||
import { map as mapAsync } from 'bluebird'; | ||
|
||
export function RollupPageProvider({ getService, getPageObjects }) { | ||
const testSubjects = getService('testSubjects'); | ||
const log = getService('log'); | ||
const PageObjects = getPageObjects(['header', 'common']); | ||
|
||
|
||
class RollupJobPage { | ||
async createNewRollUpJob() { | ||
await testSubjects.click('createRollupJobButton'); | ||
} | ||
|
||
async verifyStepIsActive(stepNumber) { | ||
await testSubjects.exists(`createRollupStep${stepNumber}--active`); | ||
} | ||
|
||
async addRoleNameandIndexPattern(name, indexPattern) { | ||
log.debug(`Adding name ${name} to form`); | ||
await testSubjects.setValue('rollupJobName', name); | ||
await testSubjects.setValue('rollupIndexPattern', indexPattern); | ||
} | ||
|
||
async verifyIndexPatternAccepted() { | ||
const span = await testSubjects.find('fieldIndexPatternSuccessMessage'); | ||
const message = await span.findByCssSelector('p'); | ||
const text = await message.getVisibleText(); | ||
expect(text).to.be.equal('Success! Index pattern has matching indices.'); | ||
} | ||
|
||
async setIndexName(name) { | ||
await testSubjects.setValue('rollupIndexName', name); | ||
} | ||
|
||
async moveToNextStep() { | ||
await testSubjects.click('rollupJobNextButton'); | ||
} | ||
|
||
async setJobInterval(time) { | ||
await testSubjects.setValue('rollupJobInterval', time); | ||
} | ||
|
||
async saveJob() { | ||
await testSubjects.click('rollupJobSaveButton'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
} | ||
|
||
async getJobList() { | ||
const jobs = await testSubjects.findAll('jobTableRow'); | ||
return mapAsync(jobs, async job => { | ||
const jobNameElement = await job.findByCssSelector('[data-test-subj="jobTableCell-id"]'); | ||
const jobStatusElement = await job.findByCssSelector('[data-test-subj="jobTableCell-status"]'); | ||
const jobIndexPatternElement = await job.findByCssSelector('[data-test-subj="jobTableCell-indexPattern"]'); | ||
const jobRollUpIndexPatternElement = await job.findByCssSelector('[data-test-subj="jobTableCell-rollupIndex"]'); | ||
const jobDelayElement = await job.findByCssSelector('[data-test-subj="jobTableCell-delay"]'); | ||
const jobIntervalElement = await job.findByCssSelector('[data-test-subj="jobTableCell-interval"]'); | ||
const jobGroupElement = await job.findByCssSelector('[data-test-subj="jobTableCell-groups"]'); | ||
const jobMetricsElement = await job.findByCssSelector('[data-test-subj="jobTableCell-metrics"]'); | ||
|
||
return { | ||
jobName: await jobNameElement.getVisibleText(), | ||
jobStatus: await jobStatusElement.getVisibleText(), | ||
jobIndexPattern: await jobIndexPatternElement.getVisibleText(), | ||
jobRollUpIndexPattern: await jobRollUpIndexPatternElement.getVisibleText(), | ||
jobDelayElement: await jobDelayElement.getVisibleText(), | ||
jobInterval: await jobIntervalElement.getVisibleText(), | ||
jobGroup: await jobGroupElement.getVisibleText(), | ||
jobMetrics: await jobMetricsElement.getVisibleText() | ||
}; | ||
}); | ||
} | ||
|
||
} | ||
return new RollupJobPage(); | ||
} |