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
12 changes: 10 additions & 2 deletions playwright/Customizations/AAP.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import * as fsPromises from 'fs/promises';
import * as path from 'path';

import { expect } from '@playwright/test';
import { v4 as uuidv4 } from 'uuid';

Expand Down Expand Up @@ -183,15 +186,20 @@ test('Create a blueprint with AAP registration customization', async ({
.getByRole('button', { name: 'Save changes to blueprint' })
.click();
});

let exportedBP = '';
// This is for hosted service only as these features are not available in cockpit plugin
await test.step('Export BP', async (step) => {
step.skip(!isHosted(), 'Exporting is not available in the plugin');
await exportBlueprint(page, blueprintName);
exportedBP = await exportBlueprint(page);
await cleanup.add(async () => {
await fsPromises.rm(path.dirname(exportedBP), { recursive: true });
});
});

await test.step('Import BP', async (step) => {
step.skip(!isHosted(), 'Importing is not available in the plugin');
await importBlueprint(page, blueprintName);
await importBlueprint(page, exportedBP);
});

await test.step('Review imported BP', async (step) => {
Expand Down
28 changes: 23 additions & 5 deletions playwright/Customizations/Filesystem.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import * as fsPromises from 'fs/promises';
import * as path from 'path';

import { expect } from '@playwright/test';
import { v4 as uuidv4 } from 'uuid';

import { FILE_SYSTEM_CUSTOMIZATION_URL } from '../../src/constants';
import { test } from '../fixtures/cleanup';
import { exportedFilesystemBP } from '../fixtures/data/exportBlueprintContents';
import { isHosted } from '../helpers/helpers';
import { ensureAuthenticated } from '../helpers/login';
import {
Expand All @@ -18,6 +22,7 @@ import {
fillInImageOutputGuest,
importBlueprint,
registerLater,
verifyExportedBlueprint,
} from '../helpers/wizardHelpers';

test('Create a blueprint with Filesystem customization', async ({
Expand Down Expand Up @@ -178,15 +183,28 @@ test('Create a blueprint with Filesystem customization', async ({
.click();
});

// This is for hosted service only as these features are not available in cockpit plugin
await test.step('Export BP', async (step) => {
step.skip(!isHosted(), 'Exporting is not available in the plugin');
await exportBlueprint(page, blueprintName);
let exportedBP = '';
await test.step('Export BP', async () => {
exportedBP = await exportBlueprint(page);
await cleanup.add(async () => {
await fsPromises.rm(path.dirname(exportedBP), { recursive: true });
});
});

await test.step('Review exported BP', async (step) => {
step.skip(
isHosted(),
'Only verify the contents of the exported blueprint in cockpit',
);
await verifyExportedBlueprint(
exportedBP,
exportedFilesystemBP(blueprintName),
);
});

await test.step('Import BP', async (step) => {
step.skip(!isHosted(), 'Importing is not available in the plugin');
await importBlueprint(page, blueprintName);
await importBlueprint(page, exportedBP);
});

await test.step('Review imported BP', async (step) => {
Expand Down
28 changes: 23 additions & 5 deletions playwright/Customizations/Firewall.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as fsPromises from 'fs/promises';
import * as path from 'path';

import { expect } from '@playwright/test';
import { v4 as uuidv4 } from 'uuid';

import { test } from '../fixtures/customizations';
import { exportedFirewallBP } from '../fixtures/data/exportBlueprintContents';
import { isHosted } from '../helpers/helpers';
import { ensureAuthenticated } from '../helpers/login';
import {
Expand All @@ -17,6 +21,7 @@ import {
fillInImageOutputGuest,
importBlueprint,
registerLater,
verifyExportedBlueprint,
} from '../helpers/wizardHelpers';

test('Create a blueprint with Firewall customization', async ({
Expand Down Expand Up @@ -194,15 +199,28 @@ test('Create a blueprint with Firewall customization', async ({
.click();
});

// This is for hosted service only as these features are not available in cockpit plugin
await test.step('Export BP', async (step) => {
step.skip(!isHosted(), 'Exporting is not available in the plugin');
await exportBlueprint(page, blueprintName);
let exportedBP = '';
await test.step('Export BP', async () => {
exportedBP = await exportBlueprint(page);
await cleanup.add(async () => {
await fsPromises.rm(path.dirname(exportedBP), { recursive: true });
});
});

await test.step('Review exported BP', async (step) => {
step.skip(
isHosted(),
'Only verify the contents of the exported blueprint in cockpit',
);
await verifyExportedBlueprint(
exportedBP,
exportedFirewallBP(blueprintName),
);
});

await test.step('Import BP', async (step) => {
step.skip(!isHosted(), 'Importing is not available in the plugin');
await importBlueprint(page, blueprintName);
await importBlueprint(page, exportedBP);
});

await test.step('Review imported BP', async (step) => {
Expand Down
28 changes: 23 additions & 5 deletions playwright/Customizations/Hostname.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as fsPromises from 'fs/promises';
import * as path from 'path';

import { expect } from '@playwright/test';
import { v4 as uuidv4 } from 'uuid';

import { test } from '../fixtures/customizations';
import { exportedHostnameBP } from '../fixtures/data/exportBlueprintContents';
import { isHosted } from '../helpers/helpers';
import { ensureAuthenticated } from '../helpers/login';
import {
Expand All @@ -17,6 +21,7 @@ import {
fillInImageOutputGuest,
importBlueprint,
registerLater,
verifyExportedBlueprint,
} from '../helpers/wizardHelpers';

test('Create a blueprint with Hostname customization', async ({
Expand Down Expand Up @@ -67,15 +72,28 @@ test('Create a blueprint with Hostname customization', async ({
.click();
});

// This is for hosted service only as these features are not available in cockpit plugin
await test.step('Export BP', async (step) => {
step.skip(!isHosted(), 'Exporting is not available in the plugin');
await exportBlueprint(page, blueprintName);
let exportedBP = '';
await test.step('Export BP', async () => {
exportedBP = await exportBlueprint(page);
await cleanup.add(async () => {
await fsPromises.rm(path.dirname(exportedBP), { recursive: true });
});
});

await test.step('Review exported BP', async (step) => {
step.skip(
isHosted(),
'Only verify the contents of the exported blueprint in cockpit',
);
await verifyExportedBlueprint(
exportedBP,
exportedHostnameBP(blueprintName),
);
});

await test.step('Import BP', async (step) => {
step.skip(!isHosted(), 'Importing is not available in the plugin');
await importBlueprint(page, blueprintName);
await importBlueprint(page, exportedBP);
});

await test.step('Review imported BP', async (step) => {
Expand Down
25 changes: 20 additions & 5 deletions playwright/Customizations/Kernel.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as fsPromises from 'fs/promises';
import * as path from 'path';

import { expect } from '@playwright/test';
import { v4 as uuidv4 } from 'uuid';

import { test } from '../fixtures/customizations';
import { exportedKernelBP } from '../fixtures/data/exportBlueprintContents';
import { isHosted } from '../helpers/helpers';
import { ensureAuthenticated } from '../helpers/login';
import {
Expand All @@ -17,6 +21,7 @@ import {
fillInImageOutputGuest,
importBlueprint,
registerLater,
verifyExportedBlueprint,
} from '../helpers/wizardHelpers';

test('Create a blueprint with Kernel customization', async ({
Expand Down Expand Up @@ -105,15 +110,25 @@ test('Create a blueprint with Kernel customization', async ({
.click();
});

// This is for hosted service only as these features are not available in cockpit plugin
await test.step('Export BP', async (step) => {
step.skip(!isHosted(), 'Exporting is not available in the plugin');
await exportBlueprint(page, blueprintName);
let exportedBP = '';
await test.step('Export BP', async () => {
exportedBP = await exportBlueprint(page);
await cleanup.add(async () => {
await fsPromises.rm(path.dirname(exportedBP), { recursive: true });
});
});

await test.step('Review exported BP', async (step) => {
step.skip(
isHosted(),
'Only verify the contents of the exported blueprint in cockpit',
);
await verifyExportedBlueprint(exportedBP, exportedKernelBP(blueprintName));
});

await test.step('Import BP', async (step) => {
step.skip(!isHosted(), 'Importing is not available in the plugin');
await importBlueprint(page, blueprintName);
await importBlueprint(page, exportedBP);
});

await test.step('Review imported BP', async (step) => {
Expand Down
25 changes: 20 additions & 5 deletions playwright/Customizations/Locale.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as fsPromises from 'fs/promises';
import * as path from 'path';

import { expect } from '@playwright/test';
import { v4 as uuidv4 } from 'uuid';

import { test } from '../fixtures/customizations';
import { exportedLocaleBP } from '../fixtures/data/exportBlueprintContents';
import { isHosted } from '../helpers/helpers';
import { ensureAuthenticated } from '../helpers/login';
import {
Expand All @@ -17,6 +21,7 @@ import {
fillInImageOutputGuest,
importBlueprint,
registerLater,
verifyExportedBlueprint,
} from '../helpers/wizardHelpers';

test('Create a blueprint with Locale customization', async ({
Expand Down Expand Up @@ -125,15 +130,25 @@ test('Create a blueprint with Locale customization', async ({
.click();
});

// This is for hosted service only as these features are not available in cockpit plugin
await test.step('Export BP', async (step) => {
step.skip(!isHosted(), 'Exporting is not available in the plugin');
await exportBlueprint(page, blueprintName);
let exportedBP = '';
await test.step('Export BP', async () => {
exportedBP = await exportBlueprint(page);
await cleanup.add(async () => {
await fsPromises.rm(path.dirname(exportedBP), { recursive: true });
});
});

await test.step('Review exported BP', async (step) => {
step.skip(
isHosted(),
'Only verify the contents of the exported blueprint in cockpit',
);
await verifyExportedBlueprint(exportedBP, exportedLocaleBP(blueprintName));
});

await test.step('Import BP', async (step) => {
step.skip(!isHosted(), 'Importing is not available in the plugin');
await importBlueprint(page, blueprintName);
await importBlueprint(page, exportedBP);
});

await test.step('Review imported BP', async (step) => {
Expand Down
12 changes: 9 additions & 3 deletions playwright/Customizations/OpenSCAP.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import * as fsPromises from 'fs/promises';
import * as path from 'path';

import { expect } from '@playwright/test';
import { v4 as uuidv4 } from 'uuid';

Expand Down Expand Up @@ -228,13 +231,16 @@ test('Create a blueprint with OpenSCAP customization', async ({
.click();
});

// This is for hosted service only as these features are not available in cockpit plugin
let exportedBP = '';
await test.step('Export BP', async () => {
await exportBlueprint(page, blueprintName);
exportedBP = await exportBlueprint(page);
await cleanup.add(async () => {
await fsPromises.rm(path.dirname(exportedBP), { recursive: true });
});
});

await test.step('Import BP', async () => {
await importBlueprint(page, blueprintName);
await importBlueprint(page, exportedBP);
});

await test.step('Review imported BP', async () => {
Expand Down
15 changes: 10 additions & 5 deletions playwright/Customizations/Registration.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import * as fsPromises from 'fs/promises';
import * as path from 'path';

import { expect } from '@playwright/test';
import { v4 as uuidv4 } from 'uuid';

Expand Down Expand Up @@ -353,15 +356,17 @@ registrationModes.forEach(
.click();
});

// This is for hosted service only as these features are not available in cockpit plugin
await test.step('Export blueprint', async (step) => {
step.skip(!isHosted(), 'Exporting is not available in the plugin');
await exportBlueprint(page, blueprintName);
let exportedBP = '';
await test.step('Export blueprint', async () => {
exportedBP = await exportBlueprint(page);
await cleanup.add(async () => {
await fsPromises.rm(path.dirname(exportedBP), { recursive: true });
});
});

await test.step('Import blueprint', async (step) => {
step.skip(!isHosted(), 'Importing is not available in the plugin');
await importBlueprint(page, blueprintName);
await importBlueprint(page, exportedBP);
});

await test.step('Verify import does not change registration settings', async (step) => {
Expand Down
Loading
Loading