Merge branch 'release/4.2' into release/4.3

pull/3276/head
Jens Ulferts 9 years ago
commit 5f2b93fdb3
  1. 45
      frontend/tests/integration/specs/work-packages/details-pane/details-pane-editable-spec.js
  2. 2
      frontend/tests/integration/specs/work-packages/details-pane/details-pane-helper.js
  3. 14
      frontend/tests/integration/specs/work-packages/work-packages-spec.js
  4. 4
      spec/features/menu_items/query_menu_item_spec.rb
  5. 2
      spec/features/work_packages/details/inplace_editor/work_package_field.rb

@ -33,45 +33,42 @@ var expect = require('../../../spec_helper.js').expect,
describe('OpenProject', function(){ describe('OpenProject', function(){
describe('editable', function() { describe('editable', function() {
describe('subject', function() { describe('subject', function() {
var subjectEditor;
beforeEach(function() { var subjectEditor = function(paneNumber) {
subjectEditor = element(by.css('.inplace-edit.attribute-subject')); return detailsPaneHelper.loadPane(paneNumber, 'overview').then(function() {
return element(by.css('.inplace-edit.attribute-subject'));
}); });
};
context('work package with update link', function() { context('work package with update link', function() {
beforeEach(function() {
detailsPaneHelper.loadPane(819, 'overview');
});
it('should render an editable subject', function() { it('should render an editable subject', function() {
expect(subjectEditor.$('.inplace-editing--trigger-link').isPresent()).to.eventually.be.true; subjectEditor(819).then(function(editor) {
expect(editor.$('.inplace-editing--trigger-link').isPresent())
.to.eventually.be.true;
}); });
}); });
context('work package without update link', function() {
beforeEach(function() {
detailsPaneHelper.loadPane(820, 'overview');
}); });
context('work package without update link', function() {
it('should not render an editable subject', function() { it('should not render an editable subject', function() {
expect(subjectEditor.$('.inplace-editing--trigger-link').isPresent()).to.eventually.be.false; subjectEditor(820).then(function(editor) {
expect(editor.$('.inplace-editing--trigger-link').isPresent())
.to.eventually.be.false;
}); });
}); });
context('work package with a wrong version', function() {
beforeEach(function() {
detailsPaneHelper.loadPane(821, 'overview');
subjectEditor.$('.inplace-editing--trigger-link').click();
subjectEditor.$('.inplace-edit--control--save a').click();
}); });
context('work package with a wrong version', function() {
it('should render an error', function() { it('should render an error', function() {
expect( subjectEditor(821).then(function(editor) {
subjectEditor editor.$('.inplace-editing--trigger-link').click();
.$('.inplace-edit--errors') editor.$('.inplace-edit--control--save a').click();
.isDisplayed()
).to.eventually.be.true; return editor;
}).then(function(editor) {
expect(editor.$('.inplace-edit--errors').isDisplayed())
.to.eventually.be.true;
});
}); });
}); });
}); });

@ -32,7 +32,7 @@ var expect = require('../../../spec_helper.js').expect,
function loadPane(workPackageId, paneName) { function loadPane(workPackageId, paneName) {
var page = new WorkPackageDetailsPane(workPackageId, paneName); var page = new WorkPackageDetailsPane(workPackageId, paneName);
page.get(); page.get();
browser.waitForAngular(); return browser.waitForAngular();
} }
function showAll() { function showAll() {

@ -46,15 +46,19 @@ describe('OpenProject', function() {
it('should show work packages', function() { it('should show work packages', function() {
page.get(); page.get();
page.getTableHeaders().getText().then(function(text) { page.getTableHeaders().map(function(heading) {
expect(text).to.include.members([ return heading.getText();
'', }).then(function(headingTexts) {
var expected = ['',
'ID', 'ID',
'TYPE', 'TYPE',
'STATUS', 'STATUS',
'SUBJECT', 'SUBJECT',
'ASSIGNEE' 'ASSIGNEE'];
]);
for (var i = 0; i < expected.length; i++) {
expect(headingTexts[i]).to.equal(expected[i]);
}
}); });
}); });
}); });

@ -103,11 +103,11 @@ feature 'Query menu items' do
end end
it 'displaying a success message', js: true do it 'displaying a success message', js: true do
flash_element = page.find('.flash', visible: true) expect(page).to have_selector('.flash', text: 'Successful update')
expect(flash_element.text).to eq 'Successful update.'
end end
it 'is renaming and reordering the list', js: true do it 'is renaming and reordering the list', js: true do
ng_wait
# Renaming the query should also reorder the queries. As it is renamed # Renaming the query should also reorder the queries. As it is renamed
# from zzzz to aaaa, it should now be the first query menu item. # from zzzz to aaaa, it should now be the first query menu item.
expect(page).to have_selector('li:nth-child(3) a', text: new_name) expect(page).to have_selector('li:nth-child(3) a', text: new_name)

@ -11,7 +11,7 @@ class WorkPackageField
end end
def read_state_text def read_state_text
@element.find('.inplace-edit--read-value span').text @element.find('.inplace-edit--read-value').text
end end
def trigger_link def trigger_link

Loading…
Cancel
Save