Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export default tseslint.config(
rules: {
...playwright.configs['flat/recommended'].rules,
'playwright/expect-expect': 'off',
'playwright/valid-title': 'off', //TODO: avoid using looping e2e tests
'playwright/require-soft-assertions': 'error',
'playwright/prefer-native-locators': 'error',
'playwright/prefer-to-be': 'error',
'playwright/prefer-to-contain': 'error',
'playwright/no-wait-for-timeout': 'error',
},
},
{
Expand Down
28 changes: 9 additions & 19 deletions packages/insomnia-smoke-test/tests/critical/backup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,13 @@ import { test } from '../../playwright/test';

test('can backup data on new version available', async ({ app, page }) => {
const dataPath = await app.evaluate(async ({ app }) => app.getPath('userData'));
let foundBackups = false;
// retry 5 times
for (let i = 0; i < 5; i++) {
console.log('Retry', i);
if (fs.existsSync(path.join(dataPath, 'backups'))) {
console.log('Backups exists!');
const rootBackupsFolder = fs.readdirSync(path.join(dataPath, 'backups'));
const backupDir = fs.readdirSync(path.join(dataPath, 'backups', rootBackupsFolder[0]));
const hasFilesInsideBackup = backupDir.length > 0;
const hasProjectDbFile = backupDir.includes('insomnia.Project.db');
foundBackups = hasFilesInsideBackup && hasProjectDbFile;
break;
} else {
console.log('backups not found. Waiting 5 seconds...');
await page.waitForTimeout(5000);
}
}

expect.soft(foundBackups).toBe(true);
await page.getByRole('button', { name: 'Create request collection' }).click();
await page.getByRole('button', { name: 'Send' }).click();
await page.getByText('Error: URL using bad/illegal').click();
const rootBackupsFolder = fs.readdirSync(path.join(dataPath, 'backups'));
const backupDir = fs.readdirSync(path.join(dataPath, 'backups', rootBackupsFolder[0]));
const hasFilesInsideBackup = backupDir.length > 0;
const hasProjectDbFile = backupDir.includes('insomnia.Project.db');
expect.soft(hasFilesInsideBackup).toBe(true);
expect.soft(hasProjectDbFile).toBe(true);
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ test.describe('after-response script features tests', () => {
await page.getByTestId('request-pane').getByRole('button', { name: 'Send' }).click();

// verify response
await page.waitForSelector('[data-testid="response-status-tag"]:visible');
await expect.soft(statusTag).toContainText('200 OK');

// verify
Expand Down Expand Up @@ -78,7 +77,6 @@ test.describe('after-response script features tests', () => {
await page.getByTestId('request-pane').getByRole('button', { name: 'Send' }).click();

// verify response
await page.waitForSelector('[data-testid="response-status-tag"]:visible');
await expect.soft(statusTag1).toContainText('200 OK');

// verify persisted environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ test.describe('Check vault used in environment', () => {
},
});

test('test global private sub environment to store vaults', async ({ page, app }) => {
test('global private sub environment to store vaults', async ({ page, app }) => {
await page.getByTestId('settings-button').click();
await page.getByTestId('dataFolders').fill(getFixturePath('vault-collection.yaml'));
await page.getByTestId('dataFolders-btn').click();
Expand Down
3 changes: 2 additions & 1 deletion packages/insomnia-smoke-test/tests/smoke/mock.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test } from '../../playwright/test';

// @TODO - Bring this back once the stage server is up and running
// @TODO - Bring this back once the stage server is back up and running and remove the ignore line below
// eslint-disable-next-line playwright/no-skipped-test
test.skip('can make a mock route: WARNING: THIS TEST DEPENDS ON mock-stage.insomnia.run to be up', async ({ page }) => {
test.slow(process.platform === 'darwin' || process.platform === 'win32', 'Slow app start on these platforms');

Expand Down
18 changes: 3 additions & 15 deletions packages/insomnia-smoke-test/tests/smoke/oauth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,7 @@ test('can make oauth2 requests', async ({ app, page }) => {
await expect.soft(responseBody).toContainText('"sub": "fresh"');

// Reset the OAuth 2 session from Preferences
if (process.platform === 'darwin') {
await page.keyboard.press('Meta+,');
} else {
await page.keyboard.press('Control+,');
}
await page.getByTestId('settings-button').click();
await page.locator('button:has-text("Clear OAuth 2 session")').click();
await page.keyboard.press('Escape');

Expand Down Expand Up @@ -177,11 +173,7 @@ test('can make oauth2 requests', async ({ app, page }) => {
await expect.soft(responseBody).toContainText('"sub": "admin"');

// Reset the OAuth 2 session from Preferences
if (process.platform === 'darwin') {
await page.keyboard.press('Meta+,');
} else {
await page.keyboard.press('Control+,');
}
await page.getByTestId('settings-button').click();
await page.locator('button:has-text("Clear OAuth 2 session")').click();
await page.keyboard.press('Escape');

Expand All @@ -194,11 +186,7 @@ test('can make oauth2 requests', async ({ app, page }) => {
await expect.soft(responseBody).toContainText('"clientId": "client_credentials"');

// Reset the OAuth 2 session from Preferences
if (process.platform === 'darwin') {
await page.keyboard.press('Meta+,');
} else {
await page.keyboard.press('Control+,');
}
await page.getByTestId('settings-button').click();
await page.locator('button:has-text("Clear OAuth 2 session")').click();
await page.keyboard.press('Escape');

Expand Down
Loading
Loading