test: 💍 Add tcp target update test (#1800)

✅ Closes: ICU-9772
This commit is contained in:
Stan Ryzhov authored and GitHub committed 2023-07-26 15:52:50 -04:00
1 parent c12e61d617
commit e3557e297b
1 file changed
+33 -1
+33 -1
View File
@@ -4,7 +4,7 @@
*/
/* eslint-disable no-undef */
const { test } = require('@playwright/test');
const { test, expect } = require('@playwright/test');
const { execSync } = require('child_process');
const { checkEnv, authenticatedState } = require('../helpers/general');
const {
@@ -119,3 +119,35 @@ test('Verify session created to target with address, then cancel the session', a
}
}
});
test('Verify TCP target is updated', async ({ page }) => {
await page.goto('/');
let orgName;
try {
orgName = await createNewOrg(page);
await createNewProject(page);
await createNewTargetWithAddress(page);
// Update target
await page.getByRole('button', { name: 'Edit Form' }).click();
await page.getByLabel('Name').fill('New target name');
await page.getByLabel('Description').fill('New description');
await page.getByLabel('Target Address').fill('127.0.0.1');
await page.getByLabel('Default Port').fill('10');
await page.getByLabel('Default Client Port').fill('10');
await page.getByLabel('Maximum Duration').fill('1000');
await page.getByLabel('Maximum Connections').fill('10');
await page.getByLabel('Egress worker filter').click();
await page.getByRole('textbox', { name: 'Filter', exact: true }).fill('"dev" in "/tags/type"');
await page.getByRole('button', { name: 'Save' }).click();
await expect(
page.getByRole('alert').getByText('Success', { exact: true })
).toBeVisible();
} finally {
await authenticateBoundaryCli();
const orgs = JSON.parse(execSync('boundary scopes list -format json'));
const org = orgs.items.filter((obj) => obj.name === orgName)[0];
await deleteOrg(org.id);
}
});