Skip to content

Commit

Permalink
fix(tests): fix docker images protractor tests (closes #319)
Browse files Browse the repository at this point in the history
  • Loading branch information
Izak88 committed Dec 21, 2017
1 parent 9ef5544 commit e8b7d51
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 54 deletions.
47 changes: 0 additions & 47 deletions e2e/030_docker_image.e2e.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions e2e/130_team.e2e.ts → e2e/120_team.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,16 @@ describe('Teams', () => {
.then(cnt => expect(cnt).to.equal(1));
});

xit(`non admin user can remove his access token`, () => {
it(`non admin user can remove his access token`, () => {
return browser.get('/team')
.then(() => browser.wait(() => element(by.css('.edit-user-button')).isPresent()))
.then((): any => element.all(by.css('.edit-user-button')).last().click())
.then(() => browser.wait(() => element(by.css('[name="tab-tokens"]')).isPresent()))
.then((): any => element(by.css('[name="tab-tokens"]')).click())
.then(() => element.all(by.css('.access-token-item')).count())
.then(cnt => expect(cnt).to.equal(1))
.then((): any => element.all(by.css('.ion-close')).first().click())
.then((): any => element.all(by.css('[name="btn-removeToken"]')).first().click())
.then(() => delay(100))
.then(() => element.all(by.css('.access-token-item')).count())
.then(cnt => expect(cnt).to.equal(0));
});
Expand Down
File renamed without changes.
27 changes: 22 additions & 5 deletions e2e/150_images.e2e.ts → e2e/140_images.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ describe('Images', () => {
return browser.get('/images')
.then(() => element.all(by.css('.image-item')).count())
.then(cnt => expect(cnt).to.equals(0))
.then(() => element.all(by.css('.base-image-item')).count())
.then(cnt => {
if (cnt > 0) {
Promise.resolve();
} else {
return browser.wait(() => element(by.css(`[name="tab-build-image"]`)).isPresent())
.then((): any => element(by.css('[name="tab-build-image"]')).click())
.then((): any => browser.wait(() => {
return element(by.css(`[name="build-image-btn"]`)).isPresent();
}))
.then((): any => browser.wait(() => {
return element(by.css(`[name="build-image-btn"]`)).isEnabled();
}))
.then(() => element.all(by.css(`[name="build-image-btn"]`)).first().click());
}
})
.then(() => delay(5000))
.then((): any => {
return browser.wait(() => element.all(by.css('.base-image-item')).count()
.then(cnt => cnt === 1));
Expand Down Expand Up @@ -74,7 +91,7 @@ describe('Images', () => {
.then(txt => expect(txt).to.equals('FROM test-protractor-base-image'));
});

xit('should delete last base image and see only one base image', () => {
it('should try to delete last base image and cancel it at last warning', () => {
return browser.get('/images')
.then((): any => {
return browser.wait(() => element.all(by.css('.base-image-item')).count()
Expand All @@ -84,16 +101,16 @@ describe('Images', () => {
.then(() => browser.wait(() => element(by.css('.ion-close')).isDisplayed()))
.then(() => element(by.css('.ion-close')).click())
.then(() => element.all(by.css('.ion-close')).count())
.then(cnt => expect(cnt).to.equals(3))
.then(cnt => expect(cnt).to.equals(4))
.then(() => browser.wait(() => element(by.css('.ion-checkmark')).isPresent()))
.then(() => browser.wait(() => element(by.css('.ion-checkmark')).isDisplayed()))
.then(() => element(by.css('.ion-checkmark')).click())
.then(() => element.all(by.css('.ion-close')).first().click())
.then(() => delay(500))
.then((): any => {
return browser.wait(() => element.all(by.css('.base-image-item')).count()
.then(cnt => cnt === 1));
.then(cnt => cnt === 2));
})
.then(() => element.all(by.css('.ion-close')).count())
.then(cnt => expect(cnt).to.equals(0));
.then(cnt => expect(cnt).to.equals(3));
});
});

0 comments on commit e8b7d51

Please sign in to comment.