Skip to content

Commit

Permalink
[release/cog/1.68.1] Bump patch and fix e2e tests (#2326)
Browse files Browse the repository at this point in the history
* Bump patch and fix e2e tests
* Add back minimum log flag
  • Loading branch information
graduta authored Mar 14, 2024
1 parent b741556 commit 226ecb1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Control/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Control/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aliceo2/control",
"version": "1.68.0",
"version": "1.68.1",
"description": "ALICE O2 Control GUI",
"author": "George Raduta",
"contributors": [
Expand Down
29 changes: 22 additions & 7 deletions Control/test/integration/control-environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ describe('`Control Environment` test-suite', async () => {
await page.evaluate(() => document.querySelector('#buttonToSTART').click());
await waitForCoreResponse(page, reqTimeout);

const controlAction = await page.evaluate(() => window.model.environment.itemControl);
const environment = await page.evaluate(() => window.model.environment.item);
const state = environment.payload.state;
const controlAction = await page.evaluate(() => {
return {
kind: window.model.environment.itemControl.kind,
payload: window.model.environment.itemControl.payload
}
});
const environment = await page.evaluate(() => window.model.environment.item.payload);
const state = environment.state;

assert.ok(controlAction.kind !== 'Failure', `Transition of workflow '${workflowToTest}' with revision: '${revision}' was not successful due to: ${controlAction.payload}`);
assert.strictEqual(state, 'RUNNING', 'Environment was expected to be running');
Expand All @@ -74,9 +79,14 @@ describe('`Control Environment` test-suite', async () => {
await page.evaluate(() => document.querySelector('#buttonToSTOP').click());
await waitForCoreResponse(page, reqTimeout);

const controlAction = await page.evaluate(() => window.model.environment.itemControl);
const environment = await page.evaluate(() => window.model.environment.item);
const state = environment.payload.state;
const controlAction = await page.evaluate(() => {
return {
kind: window.model.environment.itemControl.kind,
payload: window.model.environment.itemControl.payload
}
});
const environment = await page.evaluate(() => window.model.environment.item.payload);
const state = environment.state;

assert.ok(controlAction.kind !== 'Failure', `Transition of workflow '${workflowToTest}' with revision: '${revision}' was not successful due to: ${controlAction.payload}`);
assert.strictEqual(state, 'CONFIGURED', 'WRONG state of environment');
Expand Down Expand Up @@ -116,7 +126,12 @@ describe('`Control Environment` test-suite', async () => {
await page.evaluate(() => document.querySelector('#buttonToFORCESHUTDOWN').click());
await waitForCoreResponse(page, reqTimeout);

const controlAction = await page.evaluate(() => window.model.environment.itemControl);
const controlAction = await page.evaluate(() => {
return {
kind: window.model.environment.itemControl.kind,
payload: window.model.environment.itemControl.payload
}
});
const location = await page.evaluate(() => window.location);

assert.ok(controlAction.kind !== 'Failure', `Transition of workflow '${workflowToTest}' with revision: '${revision}' was not successful due to: ${controlAction.payload}`);
Expand Down
20 changes: 14 additions & 6 deletions Control/test/integration/create-new-environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ describe('`pageNewEnvironment` test-suite', async () => {
});

it('should successfully request a list of template objects', async () => {
const templates = await page.evaluate(() => window.model.workflow.templates);
assert.strictEqual(templates.kind, 'Success', `Request for list of template objects failed due to: ${templates.payload}`);
assert.ok(templates.payload.length !== 0);
const templates = await page.evaluate(() => window.model.workflow.templates.match({
Success: (payload) => payload,
Other: () => null,
}));

assert.ok(templates?.length !== 0, `No templates received`);
});

it(`should successfully select workflow '${workflowToTest}' from template list`, async () => {
Expand Down Expand Up @@ -80,8 +83,9 @@ describe('`pageNewEnvironment` test-suite', async () => {

it('should have successfully lock and select detector from area list', async () => {
await page.evaluate(() => document.querySelector('.m1 > div:nth-child(1) > div > a:nth-child(1)').click());
await page.waitForTimeout(500);
await page.waitForTimeout(1000);
await page.evaluate(() => document.querySelector('.m1 > div:nth-child(1) > div > a:nth-child(2)').click());
await page.waitForTimeout(1000);
const selectedDet = await page.evaluate(() => window.model.workflow.flpSelection.selectedDetectors);
assert.deepStrictEqual(selectedDet, ['TST'], 'Missing detector selection');
await page.waitForTimeout(500);
Expand All @@ -103,10 +107,14 @@ describe('`pageNewEnvironment` test-suite', async () => {
await waitForCoreResponse(page, reqTimeout);

const location = await page.evaluate(() => window.location);
const queryResult = await page.evaluate(() => window.model.environment.itemNew);
const queryResult = await page.evaluate(() => window.model.environment.itemNew.match({
Failure: (error) => [error],
NotAsked: () => [],
Other: () => null,
}))
const revision = await page.evaluate(() => window.model.workflow.form.revision);

assert.strictEqual(queryResult.kind, 'NotAsked', `Environment ${workflowToTest} with revision ${revision} was not created due to: ${queryResult.payload}`);
assert.ok(queryResult.length === 0, `Environment ${workflowToTest} with revision ${revision} was not created due to: ${queryResult}`);
assert.ok(location.search.includes('?page=environments'), 'Failed to redirect to environments page');

// Wait for Environment to transition to CONFIGURED state
Expand Down

0 comments on commit 226ecb1

Please sign in to comment.