Skip to content

Commit

Permalink
More WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
adamyeats committed Oct 19, 2023
1 parent 6fe8841 commit 4d54fac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion e2e/k6/k6.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function addDatasource(page) {
// checks the page for the data source is working message
check(page, {
'add datasource successful':
(await page.locator('div[data-testid="data-testid Alert success"]').textContent()) === 'Success',
(await page.locator('[aria-label="Data source settings page Alert"]').textContent()) === 'Success',
});
} catch (e) {
fail(`add datasource failed: ${e}`);
Expand Down
20 changes: 10 additions & 10 deletions e2e/playwright/playwright.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ async function addDatasource(page: Page) {
await saveBtn.click();

// checks the page for the data source is working message
await expect(page.locator(`[aria-label="Data source settings page Alert"]`)).toContainText(
'Success'
);
await expect(page.locator(`[aria-label="Data source settings page Alert"]`)).toContainText('Success');
}

async function addDashboard(page: Page) {
Expand Down Expand Up @@ -105,37 +103,39 @@ async function configurePanel(page: Page) {
await addPanelButton.click();

// select data source for panel
const dsPanel = page.locator('input[placeholder="Select data source"]')
const dsPanel = page.locator('input[placeholder="Search data source"]');
await dsPanel.fill(`${DATASOURCE_NAME}`);
await page.keyboard.down('Tab');
await page.keyboard.down('Enter');

// select database
const database = page.locator(`[aria-label="Database"]`);
await database.click();
await database.click({ force: true });
await database.fill('PerfTest');
await page.keyboard.down('Enter');

// select table
const table = page.locator(`[aria-label="Table"]`);
await table.click();
await table.click({ force: true });
await table.fill('PerfTest');
await page.keyboard.down('Enter');

// run query
const runQueryBtn = page.locator(`[data-testid="data-testid run-query"]`);
await runQueryBtn.click();
await runQueryBtn.click({ force: true });

// are there results?
const columns = page.locator(`[aria-label="Columns"]`);
await columns.click();
await columns.click({ force: true });

await page.waitForTimeout(6000);

const html = await page.locator('[aria-label="Select options menu"]').innerHTML();
await expect(html).toContain('_val1_');

// save panel
const savePanelBtn = page.locator(`button[title="Apply changes and save dashboard"]`);
await savePanelBtn.click();

// save dashboard
const saveDashButton = page.locator('button[aria-label="Save dashboard button"]');
await saveDashButton.click();
}
Expand Down

0 comments on commit 4d54fac

Please sign in to comment.