Skip to content

Commit

Permalink
feat(templates): Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ebb-tide committed Aug 12, 2020
1 parent 74357b3 commit 274acaf
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 400 deletions.
14 changes: 6 additions & 8 deletions e2e/src/pages/dashboards/dashboardsPage.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const influxPage = require(__srcdir + '/pages/influxPage.js');
const { By } = require('selenium-webdriver');

const createDashboardDropdown = '[data-testid=add-resource-dropdown--button]';
const createDashboardDropdown = '[data-testid=add-resource-button]';
const filterDashboards = '[data-testid=search-widget]';
const sortTypeButton = '[data-testid=resource-sorter--button]:nth-of-type(1)';
const sortTypeItem = '[data-testid=\'resource-sorter--%ITEM%\']';
const modifiedSortButton = '[data-testid=resource-list--sorter]:nth-of-type(2)';
const createDashboardDropdownEmpty = '[data-testid=\'page-contents\'] [data-testid=\'add-resource-dropdown--button\']';
const createDashboardDropdownEmpty = '[data-testid=\'page-contents\'] [data-testid=\'add-resource-button\']';
const createDashboardItems = '[data-testid^=add-resource-dropdown--][id]';
const dashboardCardByName = '//*[@data-testid=\'dashboard-card\'][.//span[text() = \'%NAME%\']]';
const dashboardCardExportButton = '//*[@data-testid=\'dashboard-card\'][.//span[text() = \'%NAME%\']]//*[@class=\'context-menu--container\'][.//*[text() = \'Export\']]';
Expand Down Expand Up @@ -38,12 +38,10 @@ const addLabelsPopoverNewItem = '[data-testid^=\'inline-labels--create-new\']';

const importPopupUploadFileRadio = '[data-testid=overlay--body] [data-testid=select-group--option][title=\'Upload\']';
const importPopupPasteJSONRadio = '[data-testid=overlay--body] [data-testid=select-group--option][title=\'Paste\']';
const importPopupImportJSONButton = '[data-testid=\'overlay--footer\'] [title^=\'Import JSON\']';
const importPopupDismiss = '[data-testid=\'overlay--header\'] button';
const importPopupFileInput = '[data-testid=\'overlay--body\'] [class*=\'drag-and-drop--form\'] ';
const importPopupFileInputHeader = '[data-testid=\'overlay--body\'] [class*=\'drag-and-drop--header\']';
const importPopupDragNDropFile = 'input[type=file]'; //N.B. has display:none
const importPopupJSONTextarea = '[data-testid=\'overlay--body\'] [data-testid=\'import-overlay--textarea\']';

const fromTemplatePopupDismiss = '[data-testid=\'overlay--header\'] button';
const fromTemplatePopupCancel = '[data-testid=\'overlay--footer\'] [data-testid=\'button\'][title=\'Cancel\']';
Expand Down Expand Up @@ -71,7 +69,7 @@ class dashboardsPage extends influxPage {
await super.isLoaded([{type: 'css', selector: createDashboardDropdown},
{type: 'css', selector: filterDashboards} ,
{type: 'css', selector: sortTypeButton}
// {type: 'css', selector: modifiedSortButton}
'css', selector: modifiedSortButton}
], urlCtx);
}

Expand All @@ -91,11 +89,11 @@ class dashboardsPage extends influxPage {
return await this.driver.findElement(By.css(sortTypeItem.replace('%ITEM%', item)));
}

// async getModifiedSortButton(){
// return await this.driver.findElement(By.css(modifiedSortButton));
// asyn c getModifiedSortButton(){
// return await this.driver.findElement(By.css(modifiedSortButton));
// }

async getCreateDashboardItem(item){
async getCreateDashboardItem(item){
return await this.driver.findElement(By.css(`[data-testid^=add-resource-dropdown--][id='${item}']`));
}

Expand Down
Loading

0 comments on commit 274acaf

Please sign in to comment.