Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] EVEREST-1065 removing edit db button from actions #785

Merged
merged 72 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
d122a19
EVEREST-1065 removing edit db button from actions
solovevayaroslavna Oct 24, 2024
7b96972
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 12, 2024
1a54c8f
EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 12, 2024
2fbe7ff
EVEREST-1065-remove-edit-button: removing basic info edit e2e test, a…
solovevayaroslavna Nov 14, 2024
5d07d83
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 14, 2024
9c863e4
EVEREST-1065-remove-edit-button: removing basic info edit e2e test, a…
solovevayaroslavna Nov 14, 2024
8d128d5
chore: lint/format
solovevayaroslavna Nov 14, 2024
f49982f
Merge branch 'EVEREST-1065-remove-edit-button' of github.com:percona/…
solovevayaroslavna Nov 14, 2024
189290a
chore: lint/format
solovevayaroslavna Nov 14, 2024
f1c2692
trigger
solovevayaroslavna Nov 14, 2024
6ba0510
EVEREST-1065-remove-edit-button: e2e fix of upgrade test
solovevayaroslavna Nov 18, 2024
fabe597
EVEREST-1065-remove-edit-button: e2e fix of upgrade test
solovevayaroslavna Nov 18, 2024
5aff41d
EVEREST-1065-remove-edit-button: e2e fix of upgrade test
solovevayaroslavna Nov 18, 2024
5136a5f
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 18, 2024
8f9d674
EVEREST-1065-remove-edit-button: e2e resources
solovevayaroslavna Nov 19, 2024
fb1fd18
EVEREST-1065-remove-edit-button: e2e resources
solovevayaroslavna Nov 19, 2024
2d4502e
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 19, 2024
8651a5a
EVEREST-1065-remove-edit-button: e2e
solovevayaroslavna Nov 19, 2024
9077937
EVEREST-1065-remove-edit-button: e2e
solovevayaroslavna Nov 19, 2024
31c1a06
EVEREST-1065-remove-edit-button: e2e
solovevayaroslavna Nov 19, 2024
837b14c
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 20, 2024
7373a3f
EVEREST-1065-remove-edit-button: e2e
solovevayaroslavna Nov 20, 2024
61de82d
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 20, 2024
5c65c4f
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 20, 2024
a3cbd00
Test commit
tplavcic Nov 20, 2024
9582cf3
EVEREST-1065-remove-edit-button: e2e deletion unnecessary dbWizard ed…
solovevayaroslavna Nov 20, 2024
709645e
EVEREST-1065-remove-edit-button: e2e increasing timeout
solovevayaroslavna Nov 20, 2024
0c7c526
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 21, 2024
a36f312
EVEREST-1065-remove-edit-button: e2e increasing timeout + changing db
solovevayaroslavna Nov 21, 2024
2bd1b1f
EVEREST-1065-remove-edit-button: e2e changing db
solovevayaroslavna Nov 21, 2024
f6fb8b1
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 22, 2024
37d1686
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 25, 2024
c00c0fb
EVEREST-1065-remove-edit-button: e2e
solovevayaroslavna Nov 25, 2024
f2104de
EVEREST-1065-remove-edit-button: e2e
solovevayaroslavna Nov 25, 2024
85dfc20
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Nov 25, 2024
8670ed1
Merge branch 'main' into EVEREST-1065-remove-edit-button
tplavcic Nov 26, 2024
d757c67
Add temp test tmate debug session into UI tests
tplavcic Nov 26, 2024
49fa6c2
Temp test just one UI test
tplavcic Nov 26, 2024
b305caa
Fix tmate debug session
tplavcic Nov 26, 2024
f6408fe
Empty commit
tplavcic Nov 26, 2024
ae3a6ae
Increase timeout for Initializing status in db-version-upgrade.e2e.ts
tplavcic Nov 26, 2024
63f178d
Disable Initializing status check in db-version-upgrade.e2e.ts
tplavcic Nov 26, 2024
13ef790
Disable check for Initializing state in db-version-upgrade.e2e.ts test
tplavcic Nov 26, 2024
27bdd4e
Merge branch 'main' into EVEREST-1065-remove-edit-button
tplavcic Nov 26, 2024
633e30c
Remove temp change in dev-fe-e2e.yaml github workflow
tplavcic Nov 26, 2024
da3d922
Merge branch 'main' into EVEREST-1065-remove-edit-button
tplavcic Nov 27, 2024
db5152a
EVEREST-1065 - Update wait for Initializing status in resources-step.…
tplavcic Nov 27, 2024
f1992b6
Enable PXC check in db-version-upgrade.e2e.ts
tplavcic Nov 27, 2024
76c9c61
Temp change to run just one UI test
tplavcic Nov 27, 2024
575610f
Temp change for test investigation
tplavcic Nov 27, 2024
fe77b3e
Merge branch 'main' into EVEREST-1065-remove-edit-button
tplavcic Nov 28, 2024
d9663f7
Merge branch 'main' into EVEREST-1065-remove-edit-button
tplavcic Nov 29, 2024
fb68bdc
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Dec 2, 2024
69df9c0
Revert some temp changes and remove checking for initializing
tplavcic Dec 2, 2024
71655f7
Disable PXC test in UI edit-db-cluster/db-version-upgrade.e2e.ts
tplavcic Dec 2, 2024
a62964d
EVEREST-1693 - Disable initialization check for PSMDB size 1 in UI E2E
tplavcic Dec 2, 2024
5326630
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Dec 3, 2024
63b416d
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Dec 4, 2024
6f32848
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Dec 4, 2024
7fa89c4
EVEREST-1065-remove-edit-button: conflicts solving
solovevayaroslavna Dec 4, 2024
2739b09
EVEREST-1065-remove-edit-button: solve pitr validation issue (EVEREST…
solovevayaroslavna Dec 4, 2024
0af2a9a
EVEREST-1065-remove-edit-button: e2e pitr
solovevayaroslavna Dec 4, 2024
d79baf9
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Dec 4, 2024
d88a9eb
EVEREST-1065-remove-edit-button: e2e pitr
solovevayaroslavna Dec 4, 2024
b442ee2
Merge branch 'main' into EVEREST-1065-remove-edit-button
solovevayaroslavna Dec 4, 2024
87e811c
EVEREST-1065-remove-edit-button: e2e pitr
solovevayaroslavna Dec 4, 2024
41e4436
EVEREST-1065-remove-edit-button: remove edit page from router
solovevayaroslavna Dec 4, 2024
e4e1861
EVEREST-1065-remove-edit-button: fix e2e tests conflicts
solovevayaroslavna Dec 4, 2024
d841c2f
EVEREST-1065-remove-edit-button: code review fix
solovevayaroslavna Dec 4, 2024
8faa3b1
chore: lint/format
solovevayaroslavna Dec 4, 2024
ed149a6
EVEREST-1065-remove-edit-button: returning upgrade test
solovevayaroslavna Dec 4, 2024
e7d8ca9
trigger
solovevayaroslavna Dec 4, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import { expect, test } from '@playwright/test';
import { getTokenFromLocalStorage } from '@e2e/utils/localStorage';
import {
deleteDbCluster,
findDbAndClickRow,
} from '@e2e/utils/db-clusters-list';
import { getClusterDetailedInfo } from '@e2e/utils/storage-class';
import { moveForward, submitWizard } from '@e2e/utils/db-wizard';
import { waitForStatus } from '@e2e/utils/table';
import { selectDbEngine } from '@e2e/pr/db-cluster/db-wizard/db-wizard-utils';

let token: string;

[
{ db: 'psmdb', size: 1 },
// { db: 'pxc', size: 1 },
// { db: 'postgresql', size: 1 },
].forEach(
({ db, size }: { db: 'pxc' | 'psmdb' | 'postgresql'; size: number }) => {
test.describe('Overview page', () => {
test.describe.configure({ timeout: 900000 });

const clusterName = `${db}-${size}-upgrade`;

let storageClasses = [];

test.beforeAll(async ({ request }) => {
token = await getTokenFromLocalStorage();

const { storageClassNames = [] } = await getClusterDetailedInfo(
token,
request
);
storageClasses = storageClassNames;
});

test(`Upgrade ${db} version`, async ({ page, request }) => {
expect(storageClasses.length).toBeGreaterThan(0);

await page.goto('/databases');
await selectDbEngine(page, db);

await test.step('Populate basic info', async () => {
await page.getByTestId('text-input-db-name').fill(clusterName);

await page.getByTestId('select-input-db-version').waitFor();
await page.getByTestId('select-db-version-button').click();
const dbVersionOptions = await page.getByRole('option');

await dbVersionOptions.last().click();
// go to resources page
await moveForward(page);
});

await test.step('Populate resources', async () => {
await page
.getByRole('button')
.getByText(size + ' node')
.click();
await expect(page.getByText('Nº nodes: ' + size)).toBeVisible();
});

await test.step('Move forward form with default values', async () => {
//go to backups page
await moveForward(page);
//go to advanced configuration
await moveForward(page);
//go to monitoring
await moveForward(page);
});

await test.step('Submit form', async () => {
await submitWizard(page);
await expect(
page.getByText('Awesome! Your database is being created!')
).toBeVisible();
});

await test.step('Check db list and status', async () => {
await page.goto('/databases');
// TODO: try re-enable after fix for: https://perconadev.atlassian.net/browse/EVEREST-1693
if (db !== 'psmdb') {
await waitForStatus(page, clusterName, 'Initializing', 15000);
}
await waitForStatus(page, clusterName, 'Up', 600000);
});

await findDbAndClickRow(page, clusterName);

await test.step('Upgrade db on next available version', async () => {
//check upgrade btn and open modal
const upgradeBtn = page.getByTestId('upgrade-db-btn');
await expect(upgradeBtn).toBeVisible();
await upgradeBtn.click();

//populate upgrade version form
await page.getByTestId('select-input-db-version').waitFor();
await page.getByTestId('select-db-version-button').click();
const dbVersionOptionsForUpgrade = await page.getByRole('option');
const selectedDbVersionValue = await dbVersionOptionsForUpgrade
.nth(2)
.innerText();

await dbVersionOptionsForUpgrade.nth(2).click();

//submit
const upgradeModalBtn = page.getByTestId('form-dialog-upgrade');
expect(upgradeModalBtn).not.toBeDisabled();
await upgradeModalBtn.click();
await expect(page.getByTestId('upgrade-form-dialog')).not.toBeVisible(
{
timeout: 15000,
}
);

//check result
await expect(page.getByTestId(`${clusterName}-status`)).toHaveText(
'Initializing',
{ timeout: 15000 }
);
await expect(
page
.getByTestId('version-overview-section-row')
.filter({ hasText: selectedDbVersionValue })
).toBeVisible();
});

// TODO upgrading to last version leads to hiding upgradeButton
// TODO list of upgrading versions should have only later versions
// TODO upgrade button is hided during initialization

await test.step('Check db list and status', async () => {
await page.goto('/databases');
await waitForStatus(page, clusterName, 'Up', 720000);
});
});

// test(`Delete cluster [${db} size ${size}]`, async ({ page }) => {
// await deleteDbCluster(page, clusterName);
// await waitForStatus(page, clusterName, 'Deleting', 15000);
// await waitForDelete(page, clusterName, 240000);
// });
});
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
// everest
// Copyright (C) 2023 Percona LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import { expect, Page, test } from '@playwright/test';
import { createDbClusterFn, deleteDbClusterFn } from '@e2e/utils/db-cluster';
import { findDbAndClickRow } from '@e2e/utils/db-clusters-list';
import { storageLocationAutocompleteEmptyValidationCheck } from '@e2e/utils/db-wizard';
import { getBucketNamespacesMap } from '@e2e/constants';
import { waitForInitializingState } from '@e2e/utils/table';

const openPitrEditModal = async (page: Page) => {
const editResourcesButton = page.getByTestId('edit-pitr-button');
await editResourcesButton.waitFor();
await editResourcesButton.click();
expect(page.getByTestId('edit-pitr-form-dialog')).toBeVisible();
};

test.describe.serial('MySQL PITR editing', async () => {
const mySQLName = 'db-pitr-mysql';

test.beforeAll(async ({ request }) => {
await createDbClusterFn(request, {
dbName: mySQLName,
dbType: 'mysql',
numberOfNodes: '1',
cpu: 1,
disk: 1,
memory: 1,
backup: {
enabled: true,
schedules: [
{
backupStorageName: getBucketNamespacesMap()[0][0],
enabled: true,
name: 'backup-1',
schedule: '0 * * * *',
},
],
},
});
});

test.beforeEach(async ({ page }) => {
await page.goto('/databases');
await waitForInitializingState(page, mySQLName);
});

test.afterAll(async ({ request }) => {
await deleteDbClusterFn(request, mySQLName);
});

test('Enable PITR to database during editing', async ({ page }) => {
await findDbAndClickRow(page, mySQLName);

await test.step('Open edit pitr modal', async () => {
await openPitrEditModal(page);
});

await test.step('Fill pitr', async () => {
const pitrCheckbox = page
.getByTestId('switch-input-enabled')
.getByRole('checkbox');
await expect(pitrCheckbox).not.toBeChecked();
await pitrCheckbox.setChecked(true);
const pitrStorageLocation = page.getByTestId(
'text-input-storage-location'
);
await expect(pitrStorageLocation).toBeVisible();
await expect(pitrStorageLocation).not.toBeEmpty();
await pitrStorageLocation.click();
await storageLocationAutocompleteEmptyValidationCheck(
page,
'storage-location-autocomplete'
);
expect(page.getByTestId('form-dialog-save')).toBeDisabled();
const storageOptions = page.getByRole('option');
await expect(
storageOptions.filter({ hasText: getBucketNamespacesMap()[0][0] })
).toBeVisible();
await storageOptions.first().click();
});

await test.step('Submit modal form', async () => {
expect(page.getByTestId('form-dialog-save')).not.toBeDisabled();
await page.getByTestId('form-dialog-save').click();
});

await test.step('Check pitr was succesfully updated', async () => {
await expect(
page
.getByTestId('pitr-status-overview-section-row')
.filter({ hasText: 'Enabled' })
).toBeVisible();
await expect(
page
.getByTestId('backup-storage-overview-section-row')
.filter({ hasText: 'bucket-1' })
).toBeVisible();
});
});

test('Disable PITR for database during editing', async ({ page }) => {
await findDbAndClickRow(page, mySQLName);

await test.step('Open edit pitr modal', async () => {
await openPitrEditModal(page);
});

await test.step('Disable pitr', async () => {
const pitrCheckbox = page
.getByTestId('switch-input-enabled')
.getByRole('checkbox');

await expect(pitrCheckbox).toBeChecked();
const pitrStorageLocation = page.getByTestId(
'text-input-storage-location'
);
await expect(pitrStorageLocation).toBeVisible();
await expect(pitrStorageLocation).not.toBeEmpty();

await pitrCheckbox.setChecked(false);
});

await test.step('Submit modal form', async () => {
expect(page.getByTestId('form-dialog-save')).not.toBeDisabled();
await page.getByTestId('form-dialog-save').click();
});

await test.step('Check pitr was succesfully updated', async () => {
await expect(
page
.getByTestId('pitr-status-overview-section-row')
.filter({ hasText: 'Disabled' })
).toBeVisible();
await expect(
page
.getByTestId('backup-storage-overview-section-row')
.filter({ hasText: 'bucket-1' })
).not.toBeVisible();
});
});
});

test.describe.serial('MongoDb PITR editing', async () => {
const psmdbName = 'db-pitr-psmdb';

test.beforeAll(async ({ request }) => {
await createDbClusterFn(request, {
dbName: psmdbName,
dbType: 'mongodb',
numberOfNodes: '3',
cpu: 1,
disk: 1,
memory: 1,
backup: {
enabled: true,
schedules: [
{
backupStorageName: getBucketNamespacesMap()[0][0],
enabled: true,
name: 'backup-1',
schedule: '0 * * * *',
},
],
},
});
});

test.afterAll(async ({ request }) => {
await deleteDbClusterFn(request, psmdbName);
});

test.beforeEach(async ({ page }) => {
await page.goto('/databases');
await waitForInitializingState(page, psmdbName);
});

test('Enable PITR to database during editing', async ({ page }) => {
await findDbAndClickRow(page, psmdbName);

await test.step('Open edit pitr modal', async () => {
await openPitrEditModal(page);
});

await test.step('Fill pitr', async () => {
const pitrCheckbox = page
.getByTestId('switch-input-enabled')
.getByRole('checkbox');
await expect(pitrCheckbox).not.toBeChecked();
await pitrCheckbox.setChecked(true);
const pitrStorageLocation = page.getByTestId(
'text-input-storage-location'
);
await expect(pitrStorageLocation).not.toBeVisible();
});

await test.step('Submit modal form', async () => {
expect(page.getByTestId('form-dialog-save')).not.toBeDisabled();
await page.getByTestId('form-dialog-save').click();
});

await test.step('Check pitr was succesfully updated', async () => {
await expect(
page
.getByTestId('pitr-status-overview-section-row')
.filter({ hasText: 'Enabled' })
).toBeVisible();
await expect(
page
.getByTestId('backup-storage-overview-section-row')
.filter({ hasText: 'bucket-1' })
).toBeVisible();
});
});
});
Loading
Loading