|
| 1 | +import { acceptLicenseTermsAndAddDatabaseApi } from '../../../helpers/database'; |
| 2 | +import { BrowserPage } from '../../../pageObjects'; |
| 3 | +import { |
| 4 | + commonUrl, |
| 5 | + ossStandaloneConfig |
| 6 | +} from '../../../helpers/conf'; |
| 7 | +import { rte } from '../../../helpers/constants'; |
| 8 | +import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database'; |
| 9 | +import { Common } from '../../../helpers/common'; |
| 10 | + |
| 11 | +const browserPage = new BrowserPage(); |
| 12 | +const common = new Common(); |
| 13 | + |
| 14 | +let keyName: string; |
| 15 | + |
| 16 | +fixture `Actions with Key List on Browser page` |
| 17 | + .meta({type: 'critical_path', rte: rte.standalone}) |
| 18 | + .page(commonUrl) |
| 19 | + .beforeEach(async() => { |
| 20 | + await acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig, ossStandaloneConfig.databaseName); |
| 21 | + keyName = common.generateWord(10); |
| 22 | + }) |
| 23 | + .afterEach(async() => { |
| 24 | + // Delete database |
| 25 | + await deleteStandaloneDatabaseApi(ossStandaloneConfig); |
| 26 | + }); |
| 27 | +test('Verify that user can delete key in List mode', async t => { |
| 28 | + // Add new key |
| 29 | + await browserPage.addStringKey(keyName); |
| 30 | + await browserPage.deleteKeyByNameFromList(keyName); |
| 31 | + await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).notOk('The Key wasn\'t deleted'); |
| 32 | +}); |
| 33 | + |
| 34 | +test('Verify that user can delete key in Tree view', async t => { |
| 35 | + // Add new key |
| 36 | + await browserPage.addStringKey(keyName); |
| 37 | + await t.click(browserPage.treeViewButton); |
| 38 | + await browserPage.deleteKeyByNameFromList(keyName); |
| 39 | + await t.expect(await browserPage.isKeyIsDisplayedInTheList(keyName)).notOk('The Key wasn\'t deleted'); |
| 40 | +}); |
0 commit comments