From 264b0f248a50d3c73de135a60afeb9bbed26b640 Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 16 May 2018 16:47:14 -0400 Subject: [PATCH 1/9] First pass at automated jt launch tests --- .../templates/templatesList.view.html | 2 +- .../src/templates/prompt/prompt.partial.html | 36 ++-- awx/ui/test/e2e/objects/templates.js | 31 +++- awx/ui/test/e2e/tests/test-launch-jt.js | 170 ++++++++++++++++++ 4 files changed, 214 insertions(+), 25 deletions(-) create mode 100644 awx/ui/test/e2e/tests/test-launch-jt.js diff --git a/awx/ui/client/features/templates/templatesList.view.html b/awx/ui/client/features/templates/templatesList.view.html index 5aed695f57..e047b02ab6 100644 --- a/awx/ui/client/features/templates/templatesList.view.html +++ b/awx/ui/client/features/templates/templatesList.view.html @@ -35,7 +35,7 @@ - + +
- {{:: vm.strings.get('prompt.INVENTORY') }} - {{:: vm.strings.get('prompt.CREDENTIAL') }} - {{:: vm.strings.get('prompt.OTHER_PROMPTS') }} - {{:: vm.strings.get('prompt.SURVEY') }} - {{:: vm.strings.get('prompt.PREVIEW') }} + {{:: vm.strings.get('prompt.INVENTORY') }} + {{:: vm.strings.get('prompt.CREDENTIAL') }} + {{:: vm.strings.get('prompt.OTHER_PROMPTS') }} + {{:: vm.strings.get('prompt.SURVEY') }} + {{:: vm.strings.get('prompt.PREVIEW') }}
-
+
-
+
-
+
-
+
-
+
diff --git a/awx/ui/test/e2e/objects/templates.js b/awx/ui/test/e2e/objects/templates.js index 062d62c0ce..457ccf091d 100644 --- a/awx/ui/test/e2e/objects/templates.js +++ b/awx/ui/test/e2e/objects/templates.js @@ -11,7 +11,7 @@ import pagination from './sections/pagination'; import permissions from './sections/permissions'; import search from './sections/search'; -const details = createFormSection({ +const jtDetails = createFormSection({ selector: 'form', props: { formElementSelectors: [ @@ -31,6 +31,25 @@ const details = createFormSection({ } }); +const wfjtDetails = createFormSection({ + selector: 'form', + props: { + formElementSelectors: [ + '#workflow_job_template_form .Form-textInput', + '#workflow_job_template_form select.Form-dropDown', + '#workflow_job_template_form .Form-textArea', + '#workflow_job_template_form input[type="checkbox"]', + '#workflow_job_template_form .ui-spinner-input', + '#workflow_job_template_form .ScheduleToggle-switch' + ] + }, + labels: { + name: 'Name', + description: 'Description' + + } +}); + const lookupInventory = _.merge({}, lookupModal, { locateStrategy: 'xpath', selector: './/div[text()="Select inventory"]/ancestor::div[contains(@class, "modal-content")]' @@ -54,7 +73,7 @@ module.exports = { addJobTemplate: { selector: 'div[ui-view="form"]', sections: { - details + jtDetails }, elements: { title: 'div[class^="Form-title"]' @@ -63,7 +82,7 @@ module.exports = { editJobTemplate: { selector: 'div[ui-view="form"]', sections: { - details, + jtDetails, permissions }, elements: { @@ -73,7 +92,7 @@ module.exports = { addWorkflowJobTemplate: { selector: 'div[ui-view="form"]', sections: { - details + wfjtDetails }, elements: { title: 'div[class^="Form-title"]' @@ -82,7 +101,7 @@ module.exports = { editWorkflowJobTemplate: { selector: 'div[ui-view="form"]', sections: { - details, + wfjtDetails, permissions }, elements: { @@ -90,7 +109,7 @@ module.exports = { } }, list: { - selector: '.Panel', + selector: '.at-Panel', elements: { badge: 'span[class~="badge"]', title: 'div[class="List-titleText"]', diff --git a/awx/ui/test/e2e/tests/test-launch-jt.js b/awx/ui/test/e2e/tests/test-launch-jt.js new file mode 100644 index 0000000000..c2127d8dda --- /dev/null +++ b/awx/ui/test/e2e/tests/test-launch-jt.js @@ -0,0 +1,170 @@ +import { post, patch } from '../api'; +import { + getOrCreate, + getProject, + getInventory +} from '../fixtures'; + +let templateReferences = {}; + +module.exports = { + before: (client, done) => { + const resources = [ + getProject('test-launch-jt'), + getInventory('test-launch-jt') + ]; + + Promise.all(resources) + .then(([project, inventory]) => { + const noPromptPromise = getOrCreate('/job_templates/', { + name: `test-launch-jt-no-prompts`, + inventory: inventory.id, + project: project.id, + playbook: 'hello_world.yml', + }); + + const promptNoPassPromise = getOrCreate('/job_templates/', { + name: `test-launch-jt-prompts-no-pass`, + inventory: inventory.id, + ask_inventory_on_launch: true, + project: project.id, + playbook: 'hello_world.yml', + ask_diff_mode_on_launch: true, + ask_variables_on_launch: true, + ask_limit_on_launch: true, + ask_tags_on_launch: true, + ask_skip_tags_on_launch: true, + ask_job_type_on_launch: true, + ask_verbosity_on_launch: true, + ask_credential_on_launch: true + }); + + Promise.all([noPromptPromise, promptNoPassPromise]) + .then(([noPrompt, promptNoPass]) => { + templateReferences = {noPrompt, promptNoPass}; + let surveyPost = post(promptNoPass.related.survey_spec, { + name: "", + description: "", + spec: [{ + question_name: "Foo", + question_description: "", + required: true, + type: "text", + variable: "foo", + min: 0, + max: 1024, + default: "bar", + choices: "", + new_question: true + }] + }); + let surveyPatch = patch(promptNoPass.url, { survey_enabled: true }); + Promise.all([surveyPost, surveyPatch]) + .then(done); + }); + }); + }, + 'login to awx': client => { + client.login(); + client.resizeWindow(1200, 800); + client.waitForAngular(); + }, + 'expected jt launch with no prompts to navigate to job details': client => { + const templates = client.page.templates(); + templates.load(); + + templates.waitForElementVisible('input[class*="SmartSearch-input"]'); + + templates.section.list.section.search + .sendKeys('@input', `id:${templateReferences.noPrompt.id}`); + // work in progress trying to check search input for correct text + // templates.section.list.section.search.getText('@input', function(result) { + // client.assert.equal(result.value, `id:${templateReferences.noPrompt.id}`); + // }); + templates.section.list.section.search.click('i[class$="search"]'); + + templates.waitForElementVisible('div.spinny'); + templates.waitForElementNotVisible('div.spinny'); + + templates.expect.element(`#templates_list .at-Row[id="row-${templateReferences.noPrompt.id}"]`).visible; + templates.expect.element('i[class*="icon-launch"]').visible; + templates.expect.element('i[class*="icon-launch"]').enabled; + + templates.click('i[class*="icon-launch"]'); + templates.waitForElementVisible('div.spinny'); + templates.waitForElementNotVisible('div.spinny'); + + client.waitForElementVisible('at-job-details'); + }, + 'expected jt launch with prompts but no changes to navigate to job details': client => { + const templates = client.page.templates(); + + templates.load(); + templates.waitForElementVisible('input[class*="SmartSearch-input"]', 5000); + + templates.section.list.section.search + .sendKeys('@input', `id:${templateReferences.promptNoPass.id}`); + templates.section.list.section.search.click('i[class$="search"]'); + + templates.waitForElementVisible('div.spinny'); + templates.waitForElementNotVisible('div.spinny'); + + templates.expect.element(`#templates_list .at-Row[id="row-${templateReferences.promptNoPass.id}"]`).visible; + templates.expect.element('i[class*="icon-launch"]').visible; + templates.expect.element('i[class*="icon-launch"]').enabled; + + templates.click('i[class*="icon-launch"]'); + + templates.waitForElementVisible('.Prompt-previewTag'); + + templates.expect.element('#prompt_inventory_tab').visible; + templates.expect.element('#prompt_inventory_tab').to.have.attribute('class').which.contains('at-Tab--active'); + templates.expect.element('#prompt_inventory_next').visible; + templates.expect.element('#prompt_inventory_next').enabled; + + templates.click('#prompt_inventory_next'); + + templates.waitForElementVisible('#prompt_credential_step'); + + templates.expect.element('#prompt_credential_tab').visible; + templates.expect.element('#prompt_credential_tab').to.have.attribute('class').which.contains('at-Tab--active'); + templates.expect.element('#prompt_credential_next').visible; + templates.expect.element('#prompt_credential_next').enabled; + + templates.click('#prompt_credential_next'); + + templates.waitForElementVisible('#prompt_other_prompts_step'); + + templates.expect.element('#prompt_other_prompts_tab').visible; + templates.expect.element('#prompt_other_prompts_tab').to.have.attribute('class').which.contains('at-Tab--active'); + templates.expect.element('#prompt_other_prompts_next').visible; + templates.expect.element('#prompt_other_prompts_next').enabled; + + templates.click('#prompt_other_prompts_next'); + + templates.waitForElementVisible('#prompt_survey_step'); + + templates.expect.element('#prompt_survey_tab').visible; + templates.expect.element('#prompt_survey_tab').to.have.attribute('class').which.contains('at-Tab--active'); + templates.expect.element('#prompt_survey_next').visible; + templates.expect.element('#prompt_survey_next').enabled; + + templates.click('#prompt_survey_next'); + + templates.waitForElementVisible('#prompt_preview_step'); + + templates.expect.element('#prompt_preview_tab').visible; + templates.expect.element('#prompt_preview_tab').to.have.attribute('class').which.contains('at-Tab--active'); + templates.expect.element('#prompt_finish').visible; + templates.expect.element('#prompt_finish').enabled; + + templates.click('#prompt_finish'); + + templates.waitForElementVisible('div.spinny'); + templates.waitForElementNotVisible('div.spinny'); + + client.waitForElementVisible('at-job-details'); + + client.end(); + } +}; From 1d74499385c086ba0b239891eb8b88d24fcb24f4 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 24 May 2018 13:09:44 -0400 Subject: [PATCH 2/9] Added check to make sure that input contents match what we expect them to match --- awx/ui/test/e2e/tests/test-launch-jt.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/awx/ui/test/e2e/tests/test-launch-jt.js b/awx/ui/test/e2e/tests/test-launch-jt.js index c2127d8dda..8a36d0da0e 100644 --- a/awx/ui/test/e2e/tests/test-launch-jt.js +++ b/awx/ui/test/e2e/tests/test-launch-jt.js @@ -77,10 +77,9 @@ module.exports = { templates.section.list.section.search .sendKeys('@input', `id:${templateReferences.noPrompt.id}`); - // work in progress trying to check search input for correct text - // templates.section.list.section.search.getText('@input', function(result) { - // client.assert.equal(result.value, `id:${templateReferences.noPrompt.id}`); - // }); + templates.section.list.section.search.getValue('@input', function(result) { + client.assert.equal(result.value, `id:${templateReferences.noPrompt.id}`); + }); templates.section.list.section.search.click('i[class$="search"]'); templates.waitForElementVisible('div.spinny'); @@ -100,10 +99,15 @@ module.exports = { const templates = client.page.templates(); templates.load(); - templates.waitForElementVisible('input[class*="SmartSearch-input"]', 5000); + templates.waitForElementVisible('input[class*="SmartSearch-input"]'); templates.section.list.section.search .sendKeys('@input', `id:${templateReferences.promptNoPass.id}`); + + templates.section.list.section.search.getValue('@input', function(result) { + client.assert.equal(result.value, `id:${templateReferences.promptNoPass.id}`); + }); + templates.section.list.section.search.click('i[class$="search"]'); templates.waitForElementVisible('div.spinny'); From fbfaf69ee93cc677d32a86eba3f91530dc949c4d Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 24 May 2018 16:12:16 -0400 Subject: [PATCH 3/9] Added extra assertions and waits to reduce flake --- awx/ui/test/e2e/tests/test-launch-jt.js | 41 +++++-------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/awx/ui/test/e2e/tests/test-launch-jt.js b/awx/ui/test/e2e/tests/test-launch-jt.js index 8a36d0da0e..5eb50abeca 100644 --- a/awx/ui/test/e2e/tests/test-launch-jt.js +++ b/awx/ui/test/e2e/tests/test-launch-jt.js @@ -72,103 +72,78 @@ module.exports = { 'expected jt launch with no prompts to navigate to job details': client => { const templates = client.page.templates(); templates.load(); - templates.waitForElementVisible('input[class*="SmartSearch-input"]'); - templates.section.list.section.search .sendKeys('@input', `id:${templateReferences.noPrompt.id}`); templates.section.list.section.search.getValue('@input', function(result) { client.assert.equal(result.value, `id:${templateReferences.noPrompt.id}`); }); + client.pause(1000).waitForElementNotVisible('div.spinny'); + templates.waitForElementVisible('i[class$="search"]'); templates.section.list.section.search.click('i[class$="search"]'); - templates.waitForElementVisible('div.spinny'); templates.waitForElementNotVisible('div.spinny'); - + templates.expect.element('.at-Panel-headingTitleBadge').text.equal('1'); templates.expect.element(`#templates_list .at-Row[id="row-${templateReferences.noPrompt.id}"]`).visible; templates.expect.element('i[class*="icon-launch"]').visible; templates.expect.element('i[class*="icon-launch"]').enabled; - templates.click('i[class*="icon-launch"]'); templates.waitForElementVisible('div.spinny'); templates.waitForElementNotVisible('div.spinny'); - - client.waitForElementVisible('at-job-details'); + client.waitForElementVisible('at-job-details', 10000); }, 'expected jt launch with prompts but no changes to navigate to job details': client => { const templates = client.page.templates(); - templates.load(); templates.waitForElementVisible('input[class*="SmartSearch-input"]'); - templates.section.list.section.search .sendKeys('@input', `id:${templateReferences.promptNoPass.id}`); - templates.section.list.section.search.getValue('@input', function(result) { client.assert.equal(result.value, `id:${templateReferences.promptNoPass.id}`); }); - + client.pause(1000).waitForElementNotVisible('div.spinny'); + templates.waitForElementVisible('i[class$="search"]'); templates.section.list.section.search.click('i[class$="search"]'); - templates.waitForElementVisible('div.spinny'); templates.waitForElementNotVisible('div.spinny'); - + templates.expect.element('.at-Panel-headingTitleBadge').text.equal('1'); templates.expect.element(`#templates_list .at-Row[id="row-${templateReferences.promptNoPass.id}"]`).visible; templates.expect.element('i[class*="icon-launch"]').visible; templates.expect.element('i[class*="icon-launch"]').enabled; - templates.click('i[class*="icon-launch"]'); - templates.waitForElementVisible('.Prompt-previewTag'); - templates.expect.element('#prompt_inventory_tab').visible; templates.expect.element('#prompt_inventory_tab').to.have.attribute('class').which.contains('at-Tab--active'); templates.expect.element('#prompt_inventory_next').visible; templates.expect.element('#prompt_inventory_next').enabled; - templates.click('#prompt_inventory_next'); - templates.waitForElementVisible('#prompt_credential_step'); - templates.expect.element('#prompt_credential_tab').visible; templates.expect.element('#prompt_credential_tab').to.have.attribute('class').which.contains('at-Tab--active'); templates.expect.element('#prompt_credential_next').visible; templates.expect.element('#prompt_credential_next').enabled; - templates.click('#prompt_credential_next'); - templates.waitForElementVisible('#prompt_other_prompts_step'); - templates.expect.element('#prompt_other_prompts_tab').visible; templates.expect.element('#prompt_other_prompts_tab').to.have.attribute('class').which.contains('at-Tab--active'); templates.expect.element('#prompt_other_prompts_next').visible; templates.expect.element('#prompt_other_prompts_next').enabled; - templates.click('#prompt_other_prompts_next'); - templates.waitForElementVisible('#prompt_survey_step'); - templates.expect.element('#prompt_survey_tab').visible; templates.expect.element('#prompt_survey_tab').to.have.attribute('class').which.contains('at-Tab--active'); templates.expect.element('#prompt_survey_next').visible; templates.expect.element('#prompt_survey_next').enabled; - templates.click('#prompt_survey_next'); - templates.waitForElementVisible('#prompt_preview_step'); - templates.expect.element('#prompt_preview_tab').visible; templates.expect.element('#prompt_preview_tab').to.have.attribute('class').which.contains('at-Tab--active'); templates.expect.element('#prompt_finish').visible; templates.expect.element('#prompt_finish').enabled; - templates.click('#prompt_finish'); - templates.waitForElementVisible('div.spinny'); templates.waitForElementNotVisible('div.spinny'); - - client.waitForElementVisible('at-job-details'); - + client.waitForElementVisible('at-job-details', 10000); client.end(); } }; From e243cf4435598b0c7af308f013258977ecfb4196 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 24 May 2018 16:57:00 -0400 Subject: [PATCH 4/9] Fixed linting errors --- awx/ui/test/e2e/tests/test-launch-jt.js | 50 ++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/awx/ui/test/e2e/tests/test-launch-jt.js b/awx/ui/test/e2e/tests/test-launch-jt.js index 5eb50abeca..09629b6e6c 100644 --- a/awx/ui/test/e2e/tests/test-launch-jt.js +++ b/awx/ui/test/e2e/tests/test-launch-jt.js @@ -17,14 +17,14 @@ module.exports = { Promise.all(resources) .then(([project, inventory]) => { const noPromptPromise = getOrCreate('/job_templates/', { - name: `test-launch-jt-no-prompts`, + name: 'test-launch-jt-no-prompts', inventory: inventory.id, project: project.id, playbook: 'hello_world.yml', }); const promptNoPassPromise = getOrCreate('/job_templates/', { - name: `test-launch-jt-prompts-no-pass`, + name: 'test-launch-jt-prompts-no-pass', inventory: inventory.id, ask_inventory_on_launch: true, project: project.id, @@ -40,28 +40,28 @@ module.exports = { }); Promise.all([noPromptPromise, promptNoPassPromise]) - .then(([noPrompt, promptNoPass]) => { - templateReferences = {noPrompt, promptNoPass}; - let surveyPost = post(promptNoPass.related.survey_spec, { - name: "", - description: "", - spec: [{ - question_name: "Foo", - question_description: "", - required: true, - type: "text", - variable: "foo", - min: 0, - max: 1024, - default: "bar", - choices: "", - new_question: true - }] + .then(([noPrompt, promptNoPass]) => { + templateReferences = { noPrompt, promptNoPass }; + const surveyPost = post(promptNoPass.related.survey_spec, { + name: '', + description: '', + spec: [{ + question_name: 'Foo', + question_description: '', + required: true, + type: 'text', + variable: 'foo', + min: 0, + max: 1024, + default: 'bar', + choices: '', + new_question: true + }] + }); + const surveyPatch = patch(promptNoPass.url, { survey_enabled: true }); + Promise.all([surveyPost, surveyPatch]) + .then(done); }); - let surveyPatch = patch(promptNoPass.url, { survey_enabled: true }); - Promise.all([surveyPost, surveyPatch]) - .then(done); - }); }); }, 'login to awx': client => { @@ -75,7 +75,7 @@ module.exports = { templates.waitForElementVisible('input[class*="SmartSearch-input"]'); templates.section.list.section.search .sendKeys('@input', `id:${templateReferences.noPrompt.id}`); - templates.section.list.section.search.getValue('@input', function(result) { + templates.section.list.section.search.getValue('@input', (result) => { client.assert.equal(result.value, `id:${templateReferences.noPrompt.id}`); }); client.pause(1000).waitForElementNotVisible('div.spinny'); @@ -98,7 +98,7 @@ module.exports = { templates.waitForElementVisible('input[class*="SmartSearch-input"]'); templates.section.list.section.search .sendKeys('@input', `id:${templateReferences.promptNoPass.id}`); - templates.section.list.section.search.getValue('@input', function(result) { + templates.section.list.section.search.getValue('@input', (result) => { client.assert.equal(result.value, `id:${templateReferences.promptNoPass.id}`); }); client.pause(1000).waitForElementNotVisible('div.spinny'); From 2f2b19ffecd3c50828c63ebc942021e73bb65de4 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 22 Jun 2018 13:07:37 -0400 Subject: [PATCH 5/9] increase timeout threshold for login --- awx/ui/test/e2e/commands/login.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/awx/ui/test/e2e/commands/login.js b/awx/ui/test/e2e/commands/login.js index 65c9cce1ea..5be191570d 100644 --- a/awx/ui/test/e2e/commands/login.js +++ b/awx/ui/test/e2e/commands/login.js @@ -22,12 +22,12 @@ Login.prototype.command = function command (username, password) { loginPage .navigate() .waitForElementVisible('@submit', AWX_E2E_TIMEOUT_LONG) - .waitForElementNotVisible('div.spinny') + .waitForElementNotVisible('div.spinny', AWX_E2E_TIMEOUT_LONG) .setValue('@username', username) .setValue('@password', password) .click('@submit') - .waitForElementVisible('div.spinny') - .waitForElementNotVisible('div.spinny'); + .waitForElementVisible('div.spinny', AWX_E2E_TIMEOUT_LONG) + .waitForElementNotVisible('div.spinny', AWX_E2E_TIMEOUT_LONG); // temporary hack while login issue is resolved this.api.elements('css selector', '.LoginModal-alert', result => { @@ -39,8 +39,8 @@ Login.prototype.command = function command (username, password) { loginPage.setValue('@username', username); loginPage.setValue('@password', password); loginPage.click('@submit'); - loginPage.waitForElementVisible('div.spinny'); - loginPage.waitForElementNotVisible('div.spinny'); + loginPage.waitForElementVisible('div.spinny', AWX_E2E_TIMEOUT_LONG); + loginPage.waitForElementNotVisible('div.spinny', AWX_E2E_TIMEOUT_LONG); } }); }); From 9ae5ffc8caed1d8e984520e6ead1240ea214f1bd Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 22 Jun 2018 13:09:52 -0400 Subject: [PATCH 6/9] make sure project is updated before test begins --- awx/ui/test/e2e/tests/test-launch-jt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/test/e2e/tests/test-launch-jt.js b/awx/ui/test/e2e/tests/test-launch-jt.js index 09629b6e6c..d7b4082e12 100644 --- a/awx/ui/test/e2e/tests/test-launch-jt.js +++ b/awx/ui/test/e2e/tests/test-launch-jt.js @@ -1,7 +1,7 @@ import { post, patch } from '../api'; import { getOrCreate, - getProject, + getUpdatedProject, getInventory } from '../fixtures'; @@ -10,7 +10,7 @@ let templateReferences = {}; module.exports = { before: (client, done) => { const resources = [ - getProject('test-launch-jt'), + getUpdatedProject('test-launch-jt'), getInventory('test-launch-jt') ]; From ef4607b29f994cca6fbd8e5135af97dd6d30c89e Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 22 Jun 2018 13:11:42 -0400 Subject: [PATCH 7/9] make sure surveys are enabled before adding a survey --- awx/ui/test/e2e/tests/test-launch-jt.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/ui/test/e2e/tests/test-launch-jt.js b/awx/ui/test/e2e/tests/test-launch-jt.js index d7b4082e12..df9d8684ab 100644 --- a/awx/ui/test/e2e/tests/test-launch-jt.js +++ b/awx/ui/test/e2e/tests/test-launch-jt.js @@ -58,8 +58,9 @@ module.exports = { new_question: true }] }); - const surveyPatch = patch(promptNoPass.url, { survey_enabled: true }); - Promise.all([surveyPost, surveyPatch]) + + surveyPost + .then(() => patch(promptNoPass.url, { survey_enabled: true })) .then(done); }); }); From d3b71858df57223cf51f2aa9dc2ca0cc22a4af79 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 22 Jun 2018 13:13:02 -0400 Subject: [PATCH 8/9] use prompt inventory list id --- awx/ui/test/e2e/tests/test-launch-jt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/test/e2e/tests/test-launch-jt.js b/awx/ui/test/e2e/tests/test-launch-jt.js index df9d8684ab..029945803d 100644 --- a/awx/ui/test/e2e/tests/test-launch-jt.js +++ b/awx/ui/test/e2e/tests/test-launch-jt.js @@ -112,7 +112,7 @@ module.exports = { templates.expect.element('i[class*="icon-launch"]').visible; templates.expect.element('i[class*="icon-launch"]').enabled; templates.click('i[class*="icon-launch"]'); - templates.waitForElementVisible('.Prompt-previewTag'); + templates.waitForElementVisible('#prompt-inventory'); templates.expect.element('#prompt_inventory_tab').visible; templates.expect.element('#prompt_inventory_tab').to.have.attribute('class').which.contains('at-Tab--active'); templates.expect.element('#prompt_inventory_next').visible; From a50614983a8ee88c12fd5a99b87c6c6f2e5a4c5f Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 22 Jun 2018 13:20:13 -0400 Subject: [PATCH 9/9] wait for job to finish before ending tests --- awx/ui/test/e2e/tests/test-launch-jt.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/awx/ui/test/e2e/tests/test-launch-jt.js b/awx/ui/test/e2e/tests/test-launch-jt.js index 029945803d..e55072e10a 100644 --- a/awx/ui/test/e2e/tests/test-launch-jt.js +++ b/awx/ui/test/e2e/tests/test-launch-jt.js @@ -92,6 +92,10 @@ module.exports = { templates.waitForElementVisible('div.spinny'); templates.waitForElementNotVisible('div.spinny'); client.waitForElementVisible('at-job-details', 10000); + + client.useXpath(); + client.waitForElementVisible('.//span[normalize-space(text())=\'"msg": "Hello World!"\']', 60000); + client.useCss(); }, 'expected jt launch with prompts but no changes to navigate to job details': client => { const templates = client.page.templates(); @@ -145,6 +149,11 @@ module.exports = { templates.waitForElementVisible('div.spinny'); templates.waitForElementNotVisible('div.spinny'); client.waitForElementVisible('at-job-details', 10000); + + client.useXpath(); + client.waitForElementVisible('.//span[normalize-space(text())=\'"msg": "Hello World!"\']', 60000); + client.useCss(); + client.end(); } };