Skip to content

Commit

Permalink
dynamic suitename
Browse files Browse the repository at this point in the history
  • Loading branch information
midleman committed Sep 30, 2024
1 parent db5d3a8 commit 009532a
Show file tree
Hide file tree
Showing 33 changed files with 103 additions and 119 deletions.
12 changes: 5 additions & 7 deletions test/smoke/src/areas/positron/apps/shiny.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information.
*--------------------------------------------------------------------------------------------*/


import { basename, join } from 'path';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { setupEnvAndHooks } from '../../../positronUtils';
import { installAllHandlers } from '../../../utils';
import { expect } from '@playwright/test';
import { setupEnvAndHooks } from '../../../positronUtils';
import { join } from 'path';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
describe('Shiny Application', () => {
describe('Shiny Application #pr', () => {
// Shared before/after handling
installAllHandlers(logger);

Expand All @@ -34,7 +32,7 @@ if (!web) {
await PositronPythonFixtures.SetupFixtures(this.app as Application);
});

it('Python - Verify Basic Shiny App [C699099]', async function () {
it('Python - Verify Basic Shiny App [C699099] #pr', async function () {
const app = this.app as Application;

await app.workbench.quickaccess.openFile(join(app.workspacePathOrFolder, 'workspaces', 'shiny-py-example', 'app.py'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
*--------------------------------------------------------------------------------------------*/


import { basename, join } from 'path';
import { join } from 'path';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { expect } from '@playwright/test';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;
const tables = ['tracks', 'playlist_track', 'playlists', 'media_types', 'invoice_items', 'invoices', 'genres', 'employees', 'customers', 'artists', 'albums'];

Expand Down
5 changes: 2 additions & 3 deletions test/smoke/src/areas/positron/console/consoleANSI.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import { expect } from '@playwright/test';
import { Application, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename, join } from 'path';
import { join } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import * as os from 'os';
import { basename } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
4 changes: 1 addition & 3 deletions test/smoke/src/areas/positron/console/consoleHistory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
4 changes: 1 addition & 3 deletions test/smoke/src/areas/positron/console/consoleInput.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
4 changes: 1 addition & 3 deletions test/smoke/src/areas/positron/console/python-console.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information.
*--------------------------------------------------------------------------------------------*/

import { basename } from 'path';
import { Application, PositronPythonFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();

describe('Console Pane: Python', () => {

Expand Down
4 changes: 1 addition & 3 deletions test/smoke/src/areas/positron/console/r-console.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information.
*--------------------------------------------------------------------------------------------*/

import { basename } from 'path';
import { Application, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();

describe('Console Pane: R', () => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
*--------------------------------------------------------------------------------------------*/

import * as fs from 'fs';
import { basename, join } from 'path';
import { expect } from '@playwright/test';
import { installAllHandlers } from '../../../utils';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { setupEnvAndHooks } from '../../../positronUtils';
import { join } from 'path';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename, join } from 'path';
import { join } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();

describe('Data Explorer', () => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename, join } from 'path';
import { join } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();

const LAST_CELL_CONTENTS = '2013-09-30 08:00:00';
const FILTER_PARAMS = ['distance', 'is equal to', '2586'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
import { expect } from '@playwright/test';
import { Application, downloadFileFromS3, PositronPythonFixtures, PositronRFixtures, S3FileDownloadOptions } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename, join } from 'path';
import { fail } from 'assert';
import { setupEnvAndHooks } from '../../../positronUtils';
import { join } from 'path';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

// AWS Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename, join } from 'path';
import { join } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
5 changes: 2 additions & 3 deletions test/smoke/src/areas/positron/editor/fast-execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information.
*--------------------------------------------------------------------------------------------*/

import { basename, join } from 'path';
import { join } from 'path';
import { Application, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { expect } from '@playwright/test';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
48 changes: 25 additions & 23 deletions test/smoke/src/areas/positron/example.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,38 @@
*--------------------------------------------------------------------------------------------*/

// Note - these paths will need to change for your specific test location
import { Application, Logger, PositronPythonFixtures } from '../../../../automation';
import { Application, PositronPythonFixtures } from '../../../../automation';
import { setupEnvAndHooks } from '../../positronUtils';
import { installAllHandlers } from '../../utils';

export function setup(logger: Logger) {
describe('Major Test Area', () => {
// All Tests blocks inside this 'describe' block will use the same app instance
// Shared before/after handling
installAllHandlers(logger);
const logger = setupEnvAndHooks();

describe('Minor Test area', () => {
describe('Major Test Area', () => {
// All Tests blocks inside this 'describe' block will use the same app instance
// Shared before/after handling
installAllHandlers(logger);

before(async function () {
// Executes once before executing all tests.
// Change to 'beforeEach' if it needs to run before each individual test.
await PositronPythonFixtures.SetupFixtures(this.app as Application);
});
describe('Minor Test area', () => {

it('Sample Test Case A [TESTRAIL_ID]', async function () {
const app = this.app as Application; //Get handle to application
await app.workbench.positronConsole.barPowerButton.waitforVisible();
this.code.logger.log("Waiting for Power button.");
});
before(async function () {
// Executes once before executing all tests.
// Change to 'beforeEach' if it needs to run before each individual test.
await PositronPythonFixtures.SetupFixtures(this.app as Application);
});

it('Sample Test Case B [TESTRAIL_ID]', async function () {
const app = this.app as Application; //Get handle to application
await app.workbench.positronConsole.barRestartButton.waitforVisible();
this.code.logger.log("Waiting for Power button.");
});
it('Sample Test Case A [TESTRAIL_ID]', async function () {
const app = this.app as Application; //Get handle to application
await app.workbench.positronConsole.barPowerButton.waitforVisible();
this.code.logger.log("Waiting for Power button.");
});

it('Sample Test Case B [TESTRAIL_ID]', async function () {
const app = this.app as Application; //Get handle to application
await app.workbench.positronConsole.barRestartButton.waitforVisible();
this.code.logger.log("Waiting for Power button.");
});

});
}

});

4 changes: 1 addition & 3 deletions test/smoke/src/areas/positron/help/help.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
4 changes: 1 addition & 3 deletions test/smoke/src/areas/positron/layouts/layouts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import { expect } from '@playwright/test';
import { Application } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, ProjectType, ProjectWizardNavigateAction } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();

describe('Notebooks', () => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import { expect } from '@playwright/test';
import { Application, PositronPythonFixtures, PositronRFixtures } from '../../../../../automation';
import { installAllHandlers } from '../../../utils';
import { basename } from 'path';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
3 changes: 1 addition & 2 deletions test/smoke/src/areas/positron/plots/plots.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import * as fs from 'fs';
import { fail } from 'assert';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = path.basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

const diffPlotsPath = ['..', '..', '.build', 'logs', 'smoke-tests-electron'];
Expand Down
3 changes: 1 addition & 2 deletions test/smoke/src/areas/positron/quarto/quarto.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { expect } from '@playwright/test';
const path = require('path');
const fs = require('fs-extra');

const fileName = path.basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { installAllHandlers } from '../../../utils';
import { expect } from '@playwright/test';
import { setupEnvAndHooks } from '../../../positronUtils';

const fileName = path.basename(__filename);
const logger = setupEnvAndHooks(fileName);
const logger = setupEnvAndHooks();
const web = process.env.WEB;

if (!web) {
Expand Down
Loading

0 comments on commit 009532a

Please sign in to comment.