- fix intermittent failing tests from Shared Files (#539)

- rename some methods to be more clear
- use async / await - part1
This commit is contained in:
Adina Parpalita
2018-07-26 14:27:00 +01:00
committed by Denys Vuika
parent 262240c8ea
commit c6f704270f
26 changed files with 856 additions and 988 deletions
+3 -3
View File
@@ -181,7 +181,7 @@ describe('Pagination on Favorites', () => {
expect(pagination.getText(pagination.currentPage)).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
});
@@ -191,7 +191,7 @@ describe('Pagination on Favorites', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
});
@@ -204,7 +204,7 @@ describe('Pagination on Favorites', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-88.txt').isPresent())
expect(dataTable.getRowByName('file-88.txt').isPresent())
.toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -110,7 +110,7 @@ describe('Pagination on Personal Files', () => {
beforeEach(done => {
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
.then(() => dataTable.waitForHeader())
.then(() => dataTable.doubleClickOnItemNameRow(parent))
.then(() => dataTable.doubleClickOnRowByName(parent))
.then(done);
});
@@ -179,7 +179,7 @@ describe('Pagination on Personal Files', () => {
expect(pagination.currentPage.getText()).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-60.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-60.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -190,7 +190,7 @@ describe('Pagination on Personal Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-30.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-30.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -204,7 +204,7 @@ describe('Pagination on Personal Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-12.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-12.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -181,7 +181,7 @@ describe('Pagination on Recent Files', () => {
expect(pagination.currentPage.getText()).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -192,7 +192,7 @@ describe('Pagination on Recent Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -206,7 +206,7 @@ describe('Pagination on Recent Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -186,7 +186,7 @@ describe('Pagination on Shared Files', () => {
expect(pagination.currentPage.getText()).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-40.txt').isPresent())
expect(dataTable.getRowByName('file-40.txt').isPresent())
.toBe(true, 'File not found on page');
})
@@ -198,7 +198,7 @@ describe('Pagination on Shared Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -212,7 +212,7 @@ describe('Pagination on Shared Files', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
+3 -3
View File
@@ -184,7 +184,7 @@ describe('Pagination on Trash', () => {
expect(pagination.currentPage.getText()).toContain('Page 3');
expect(pagination.previousButton.isEnabled()).toBe(true, 'Previous button is not enabled');
expect(pagination.nextButton.isEnabled()).toBe(true, 'Next button is not enabled');
expect(dataTable.getRowName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-40.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -195,7 +195,7 @@ describe('Pagination on Trash', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('26-50 of 101');
expect(dataTable.getRowName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-70.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());
@@ -209,7 +209,7 @@ describe('Pagination on Trash', () => {
.then(() => dataTable.waitForHeader())
.then(() => {
expect(pagination.range.getText()).toContain('1-25 of 101');
expect(dataTable.getRowName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
expect(dataTable.getRowByName('file-88.txt').isPresent()).toBe(true, 'File not found on page');
})
.then(() => pagination.resetToDefaultPageNumber());