From 96c2607dc7b77f9ef25bd70ac99b474a88e17fd8 Mon Sep 17 00:00:00 2001 From: Filip Pospisil Date: Mon, 18 Dec 2023 10:41:33 +0100 Subject: [PATCH] FUSETOOLS2-2201 --- .github/workflows/main.yaml | 60 +++++++++++++++++++++-- src/ui-test/tests/00001.develop.test.ts | 65 +++++++++++++++++++++++++ src/ui-test/uitest_runner.ts | 2 +- 3 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 src/ui-test/tests/00001.develop.test.ts diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 71d5e9fd2..7af93f3ed 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,7 +2,7 @@ name: Main CI on: push: - branches: [ main ] + branches: [ main, FUSETOOLS2-2201 ] pull_request: branches: [ main ] workflow_dispatch: @@ -14,16 +14,63 @@ concurrency: jobs: main: strategy: - matrix: - os: [ ubuntu-latest, macos-13, windows-latest ] - version: [ "1.82.3", max ] # [ "x.x.x" | latest | max ] - type: [ stable ] # [ stable | insider ] fail-fast: false + matrix: + # os: [ ubuntu-latest, macos-13, windows-latest ] + # version: [ "1.82.3", max ] # [ "x.x.x" | latest | max ] + # type: [ stable ] # [ stable | insider ] + include: + - os: ubuntu-latest + version: "1.82.3" + type: stable + - os: ubuntu-latest + version: max + camelversion: "4.2.0" + type: stable + - os: ubuntu-latest + version: max + camelversion: "4.0.0.redhat-00031" + type: stable + - os: ubuntu-latest + version: max + camelversion: "4.0.0" + type: stable + - os: macos-13 + version: "1.82.3" + type: stable + - os: macos-13 + version: max + camelversion: "4.2.0" + type: stable + - os: macos-13 + version: max + camelversion: "4.0.0.redhat-00031" + type: stable + - os: macos-13 + version: max + camelversion: "4.0.0" + type: stable + - os: windows-latest + version: "1.82.3" + type: stable + - os: windows-latest + version: max + camelversion: "4.2.0" + type: stable + - os: windows-latest + version: max + camelversion: "4.0.0.redhat-00031" + type: stable + - os: windows-latest + version: max + camelversion: "4.0.0" + type: stable env: CODE_VERSION: ${{ matrix.version }} CODE_TYPE: ${{ matrix.type }} TEST_RESOURCES: test-resources + CAMEL_VERSION: ${{ matrix.camelversion }} runs-on: ${{ matrix.os }} steps: @@ -70,6 +117,9 @@ jobs: - name: npm-vscode:prepublish run: npm run vscode:prepublish + + - name: show camel version + run: echo $CAMEL_VERSION - name: test (ubuntu) id: test_Ubuntu diff --git a/src/ui-test/tests/00001.develop.test.ts b/src/ui-test/tests/00001.develop.test.ts new file mode 100644 index 000000000..a4f3f1221 --- /dev/null +++ b/src/ui-test/tests/00001.develop.test.ts @@ -0,0 +1,65 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License", destination); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://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 { assert } from 'chai'; +import { + CATALOG_VERSION_UI, + RESOURCES, + closeEditor, + waitUntilExtensionIsActivated, +} from '../utils/testUtils'; +import { + ActivityBar, + before, + VSBrowser, + WebDriver, + TextSetting, + Workbench +} from 'vscode-uitests-tooling'; +import * as pjson from '../../../package.json'; + +describe('mycosi', function () { + this.timeout(300000); + + let driver: WebDriver; + //let contentAssist: ContentAssist; + + before(async function () { + this.timeout(40000); + driver = VSBrowser.instance.driver; + await VSBrowser.instance.openResources(RESOURCES); + await VSBrowser.instance.waitForWorkbench(); + + await waitUntilExtensionIsActivated(driver, `${pjson.displayName}`); + await (await new ActivityBar().getViewControl('Explorer')).openView(); + }); + + it('actual version', async function () { + const settings = await new Workbench().openSettings(); + const textSetting = await settings.findSetting(CATALOG_VERSION_UI, 'Camel') as TextSetting; + + + await textSetting.setValue(process.env.CAMEL_VERSION); + + console.log("my version: " + await textSetting.getValue()); + + + await closeEditor('Settings', true); + assert.isTrue(true); + }); + +}); diff --git a/src/ui-test/uitest_runner.ts b/src/ui-test/uitest_runner.ts index d61dd5f3d..d77348879 100644 --- a/src/ui-test/uitest_runner.ts +++ b/src/ui-test/uitest_runner.ts @@ -29,7 +29,7 @@ const extensionFolder = path.join(projectPath, '.test-extensions'); async function main(): Promise { const tester = new ExTester(storageFolder, releaseType, extensionFolder); - await tester.setupAndRunTests('out/src/ui-test/tests/*.test.js', + await tester.setupAndRunTests('out/src/ui-test/tests/00001.develop.test.js', process.env.CODE_VERSION, { 'installDependencies': true