mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 22:49:32 -02:30
add jobs portal relaunch test
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<at-list results="vm.jobs" empty-list-reason="{{ vm.emptyListReason }}">
|
<at-list results="vm.jobs" empty-list-reason="{{ vm.emptyListReason }}">
|
||||||
<!-- TODO: implement resources are missing red indicator as present in mockup -->
|
<!-- TODO: implement resources are missing red indicator as present in mockup -->
|
||||||
<at-row ng-repeat="job in vm.jobs" job-id="{{ job.id }}">
|
<at-row ng-repeat="job in vm.jobs" id="job-{{ job.id }}">
|
||||||
<div class="at-Row-items">
|
<div class="at-Row-items">
|
||||||
<!-- TODO: include workflow tab as well -->
|
<!-- TODO: include workflow tab as well -->
|
||||||
<at-row-item
|
<at-row-item
|
||||||
|
|||||||
@@ -26,12 +26,14 @@
|
|||||||
<button ng-class="{'btn-primary': $state.is('portalMode.myJobs'), 'Button-primary--hollow': $state.is('portalMode.allJobs')}"
|
<button ng-class="{'btn-primary': $state.is('portalMode.myJobs'), 'Button-primary--hollow': $state.is('portalMode.allJobs')}"
|
||||||
ng-click='filterUser()'
|
ng-click='filterUser()'
|
||||||
class="btn btn-xs"
|
class="btn btn-xs"
|
||||||
|
id="my-jobs-btn"
|
||||||
translate>
|
translate>
|
||||||
My Jobs
|
My Jobs
|
||||||
</button>
|
</button>
|
||||||
<button ng-class="{'btn-primary': $state.is('portalMode.allJobs'), 'Button-primary--hollow': $state.is('portalMode.myJobs')}"
|
<button ng-class="{'btn-primary': $state.is('portalMode.allJobs'), 'Button-primary--hollow': $state.is('portalMode.myJobs')}"
|
||||||
ng-click='filterAll()'
|
ng-click='filterAll()'
|
||||||
class="btn btn-xs"
|
class="btn btn-xs"
|
||||||
|
id="all-jobs-btn"
|
||||||
translate>
|
translate>
|
||||||
All Jobs
|
All Jobs
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -38,9 +38,9 @@
|
|||||||
<at-list results="vm.templates" id="templates_list">
|
<at-list results="vm.templates" id="templates_list">
|
||||||
<at-row ng-repeat="template in vm.templates"
|
<at-row ng-repeat="template in vm.templates"
|
||||||
ng-class="{'at-Row--active': (template.id === vm.activeId)}"
|
ng-class="{'at-Row--active': (template.id === vm.activeId)}"
|
||||||
template-id="{{ template.id }}"
|
|
||||||
invalid="vm.isInvalid(template)"
|
invalid="vm.isInvalid(template)"
|
||||||
invalid-tooltip="vm.invalidTooltip">
|
invalid-tooltip="vm.invalidTooltip"
|
||||||
|
id="row-{{ template.id }}">
|
||||||
<div class="at-Row-items">
|
<div class="at-Row-items">
|
||||||
<at-row-item
|
<at-row-item
|
||||||
header-value="{{ template.name }}"
|
header-value="{{ template.name }}"
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ function atRow () {
|
|||||||
transclude: true,
|
transclude: true,
|
||||||
templateUrl,
|
templateUrl,
|
||||||
scope: {
|
scope: {
|
||||||
templateId: '@',
|
|
||||||
invalid: '=',
|
invalid: '=',
|
||||||
invalidTooltip: '='
|
invalidTooltip: '='
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="at-Row" id="row-{{ templateId }}">
|
<div class="at-Row">
|
||||||
<div class="at-Row--invalid" ng-show="invalid">
|
<div class="at-Row--invalid" ng-show="invalid">
|
||||||
<at-popover state="invalidTooltip" ng-if="invalidTooltip"></at-popover>
|
<at-popover state="invalidTooltip" ng-if="invalidTooltip"></at-popover>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
13
awx/ui/test/e2e/objects/portal.js
Normal file
13
awx/ui/test/e2e/objects/portal.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
module.exports = {
|
||||||
|
url () {
|
||||||
|
return `${this.api.globals.launch_url}/#/portal/myjobs`;
|
||||||
|
},
|
||||||
|
sections: {},
|
||||||
|
elements: {},
|
||||||
|
commands: [{
|
||||||
|
load () {
|
||||||
|
this.api.url('data:,'); // https://github.com/nightwatchjs/nightwatch/issues/1724
|
||||||
|
return this.navigate();
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
};
|
||||||
69
awx/ui/test/e2e/tests/test-jobs-portal-list-actions.js
Normal file
69
awx/ui/test/e2e/tests/test-jobs-portal-list-actions.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import {
|
||||||
|
getJob,
|
||||||
|
getJobTemplateAdmin
|
||||||
|
} from '../fixtures';
|
||||||
|
|
||||||
|
let data;
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
before: (client, done) => {
|
||||||
|
const resources = [
|
||||||
|
getJobTemplateAdmin('test-actions'),
|
||||||
|
getJob('test-actions'),
|
||||||
|
];
|
||||||
|
|
||||||
|
Promise.all(resources)
|
||||||
|
.then(([admin, job]) => {
|
||||||
|
data = { admin, job };
|
||||||
|
|
||||||
|
client.login(data.admin.username);
|
||||||
|
client.waitForAngular();
|
||||||
|
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
'relaunch a job from the \'all jobs\' list': client => {
|
||||||
|
const portal = client.page.portal();
|
||||||
|
|
||||||
|
const allJobsButton = '#all-jobs-btn';
|
||||||
|
const relaunch = `#job-${data.job.id} i[class*="launch"]`;
|
||||||
|
const search = '#portal-container-jobs smart-search input';
|
||||||
|
const spinny = 'div.spinny';
|
||||||
|
|
||||||
|
portal.load();
|
||||||
|
|
||||||
|
portal.expect.element(allJobsButton).visible;
|
||||||
|
portal.expect.element(allJobsButton).enabled;
|
||||||
|
portal.click(allJobsButton);
|
||||||
|
|
||||||
|
portal.waitForElementVisible(spinny);
|
||||||
|
portal.waitForElementNotVisible(spinny);
|
||||||
|
|
||||||
|
const query = `id:>${data.job.id - 1} id:<${data.job.id + 1}`;
|
||||||
|
|
||||||
|
portal.expect.element(search).visible;
|
||||||
|
portal.expect.element(search).enabled;
|
||||||
|
portal.sendKeys(search, query);
|
||||||
|
portal.sendKeys(search, client.Keys.ENTER);
|
||||||
|
|
||||||
|
portal.waitForElementVisible(spinny);
|
||||||
|
portal.waitForElementNotVisible(spinny);
|
||||||
|
|
||||||
|
portal.expect.element(relaunch).visible;
|
||||||
|
portal.expect.element(relaunch).enabled;
|
||||||
|
portal.click(relaunch);
|
||||||
|
|
||||||
|
portal.waitForElementVisible(spinny);
|
||||||
|
portal.waitForElementNotVisible(spinny);
|
||||||
|
|
||||||
|
const jobDetails = 'at-job-details';
|
||||||
|
const output = './/span[normalize-space(text())=\'"msg": "Hello World!"\']';
|
||||||
|
|
||||||
|
client.waitForElementVisible(jobDetails, 10000);
|
||||||
|
client.useXpath();
|
||||||
|
client.waitForElementVisible(output, 60000);
|
||||||
|
client.useCss();
|
||||||
|
|
||||||
|
client.end();
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user