Skip to content

Commit d0fb3a5

Browse files
committed
fix 12
1 parent 44eee34 commit d0fb3a5

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

tests/e2e/src/helpers/api/Eula.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,16 @@ export class Eula {
1313
)
1414
expect(await response.status).eql(200)
1515
}
16+
17+
/**
18+
* Reset eula
19+
*/
20+
static async reset(): Promise<void> {
21+
const spec = { agreements: { analytics: false, notifications: false, eula: false, encryption: false } }
22+
const response = await CommonAPIRequests.sendPatchRequest(
23+
`/settings`,
24+
spec,
25+
)
26+
expect(await response.status).eql(200)
27+
}
1628
}

tests/e2e/src/tests/setup.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
import { ButtonActions, CheckboxActions } from '@e2eSrc/helpers/common-actions'
2020
import { WelcomeView } from '@e2eSrc/page-objects/components/editor-view/WelcomeView'
2121
import { CommonElementActions } from '@e2eSrc/helpers/common-actions/actions/CommonElementActions'
22+
import { Eula } from '@e2eSrc/helpers/api/Eula'
23+
import { CommonDriverExtension } from '@e2eSrc/helpers'
2224

2325
describe('Agreements Verification', () => {
2426
let browser: VSBrowser
@@ -37,9 +39,14 @@ describe('Agreements Verification', () => {
3739
await ServerActions.waitForServerInitialized()
3840
await browser.waitForWorkbench(20_000)
3941
await new TitleBar().getWindowControls().maximize()
40-
await (await new ActivityBar().getViewControl('Redis for VS Code'))?.openView()
4142
})
4243
beforeEach(async () => {
44+
await Eula.reset()
45+
await (await new ActivityBar().getViewControl('Redis for VS Code'))?.openView()
46+
await CommonDriverExtension.driverSleep(200)
47+
await (await new ActivityBar().getViewControl('Redis for VS Code'))?.closeView()
48+
await CommonDriverExtension.driverSleep(200)
49+
await (await new ActivityBar().getViewControl('Redis for VS Code'))?.openView()
4350
await eulaView.switchToInnerViewFrame(InnerViews.EulaInnerView)
4451
await eulaView.waitForElementVisibility(eulaView.submitButton)
4552
})

tests/e2e/src/vscode.runner.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ import { VScodeScripts } from './helpers/scripts/vscodeScripts'
5858
console.log('Test Files to run: ', process.env.TEST_FILES)
5959
// Run tests
6060
await exTester.runTests(
61-
process.env.TEST_FILES || [
62-
path.join(__dirname, '..', 'dist', 'tests', 'setup.js'),
63-
path.join(__dirname, '..', 'dist', 'tests', '**', '*.js'),
64-
],
61+
((process.env.TEST_FILES ||
62+
path.join(__dirname, '..', 'dist', 'tests', '**', '*.js')).split('\n')),
6563
{
6664
settings: 'settings.json',
6765
logLevel: logging.Level.INFO,

0 commit comments

Comments
 (0)