From 268f14b061a99f04d778563b721e5dfa903fa9eb Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 3 Jun 2022 00:00:00 +0700 Subject: [PATCH] UI Sanity test fixes (#1986) Signed-off-by: Andrey Sobolev --- .github/workflows/main.yml | 64 ++++++++++++++--------------- common/config/rush/build-cache.json | 4 +- tests/sanity/package.json | 4 +- tests/sanity/tests/recruit.spec.ts | 18 ++++++++ tests/sanity/tests/settings.spec.ts | 2 + 5 files changed, 55 insertions(+), 37 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f535cf3ad9..cdf77df280 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,11 +25,6 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Cache node modules uses: actions/cache@v3 env: @@ -40,21 +35,6 @@ jobs: restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} - - name: Checking for mis-matching dependencies... - run: node common/scripts/install-run-rush.js check - - # - name: Checking for missing change logs... - # run: node common/scripts/install-run-rush.js change -v - - - name: Installing... - run: node common/scripts/install-run-rush.js install - - - name: Setting model version from git release... - run: node common/scripts/install-run-rush.js bump-model-version - - - name: Building... - run: node common/scripts/install-run-rush.js rebuild -p 16 -l --verbose - - name: Cache build results uses: actions/cache@v3 env: @@ -76,8 +56,24 @@ jobs: tests rush.json .prettierrc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} + # Checkout after restore cache + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Checking for mis-matching dependencies... + run: node common/scripts/install-run-rush.js check + + - name: Installing... + run: node common/scripts/install-run-rush.js install + + - name: Setting model version from git release... + run: node common/scripts/install-run-rush.js bump-model-version + + - name: Building... + run: node common/scripts/install-run-rush.js build -p 16 -l svelte-check: needs: build runs-on: ubuntu-latest @@ -107,8 +103,8 @@ jobs: tests rush.json .prettierrc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} - name: Checking svelte sources... run: node common/scripts/install-run-rush.js svelte-check @@ -141,8 +137,8 @@ jobs: tests rush.json .prettierrc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} - name: Linting... run: node common/scripts/install-run-rush.js lint -p 16 @@ -175,8 +171,8 @@ jobs: tests rush.json .prettierrc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} - name: Formatting... run: node common/scripts/install-run-rush.js format -p 16 @@ -217,8 +213,8 @@ jobs: tests rush.json .prettierrc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} - name: Start MongoDB uses: supercharge/mongodb-github-action@1.7.0 @@ -263,8 +259,8 @@ jobs: tests rush.json .prettierrc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} - name: Installing... run: node common/scripts/install-run-rush.js install @@ -320,8 +316,8 @@ jobs: tests rush.json .prettierrc - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref }} - name: Installing... run: node common/scripts/install-run-rush.js install diff --git a/common/config/rush/build-cache.json b/common/config/rush/build-cache.json index 04cdd9cc7a..a588ceb446 100644 --- a/common/config/rush/build-cache.json +++ b/common/config/rush/build-cache.json @@ -10,7 +10,7 @@ * * See https://rushjs.io/pages/maintainer/build_cache/ for details about this experimental feature. */ - "buildCacheEnabled": false, + "buildCacheEnabled": true, /** * (Required) Choose where project build outputs will be cached. @@ -23,7 +23,7 @@ * Setting this property overrides the cache entry ID. If this property is set, it must contain * a [hash] token. It may also contain a [projectName] or a [projectName:normalize] token. */ - // "cacheEntryNamePattern": "[projectName:normalize]-[hash]" + "cacheEntryNamePattern": "[projectName:normalize]-[hash]", /** * Use this configuration with "cacheProvider"="azure-blob-storage" diff --git a/tests/sanity/package.json b/tests/sanity/package.json index 003e36950c..338da90a32 100644 --- a/tests/sanity/package.json +++ b/tests/sanity/package.json @@ -36,6 +36,8 @@ }, "dependencies": { "dotenv": "~16.0.0", - "cross-env": "~7.0.3" + "cross-env": "~7.0.3", + "@anticrm/core": "~0.6.16", + "@anticrm/client-resources": "~0.6.4" } } diff --git a/tests/sanity/tests/recruit.spec.ts b/tests/sanity/tests/recruit.spec.ts index d6e9c07e28..38ce7d7b5d 100644 --- a/tests/sanity/tests/recruit.spec.ts +++ b/tests/sanity/tests/recruit.spec.ts @@ -82,6 +82,7 @@ test.describe('recruit tests', () => { await page.click('button:has-text("Vacancy")') + await page.fill('[placeholder="Search..."]', vacancyId) await page.click(`button:has-text("${vacancyId}")`) await page.click('button:has-text("Create")') @@ -170,4 +171,21 @@ test.describe('recruit tests', () => { await page.click('text=Create') await page.click('td:has-text("RVE-")') }) + + test('test-create-skill', async ({ page }) => { + await page.click('[id="app-recruit\\:string\\:RecruitApplication"]') + await page.click('text=Skills') + await page.click('button:has-text("Skill")') + await page.click('[placeholder="Please\\ type\\ skill\\ title"]') + const skillId = 'custom-skill-' + generateId() + await page.fill('[placeholder="Please\\ type\\ skill\\ title"]', skillId) + await page.click('button:has-text("Other")') + await page.click('button:has-text("Design")') + await page.click('button:has-text("Create")') + await page.click(`text=${skillId}`) + await page.click('[placeholder="Please\\ type\\ description\\ here"]') + await page.fill('[placeholder="Please\\ type\\ description\\ here"]', 'description-' + skillId) + await page.click('button:has-text("Save")') + await page.click(`span:has-text("description-${skillId}")`) + }) }) diff --git a/tests/sanity/tests/settings.spec.ts b/tests/sanity/tests/settings.spec.ts index be1e026b9e..6d5921d455 100644 --- a/tests/sanity/tests/settings.spec.ts +++ b/tests/sanity/tests/settings.spec.ts @@ -33,6 +33,8 @@ test.describe('contact tests', () => { if ((await page.locator('[id="gmail:string:Email"]').count()) === 0) { await page.click('[id="presentation:string:AddSocialLinks"]') await page.click('.popup button:has-text("Email")') + } else { + await page.click('id=gmail:string:Email') } // await page.hover('[id="gmail:string:Email"]') await page.fill('[placeholder="john\\.appleseed\\@apple\\.com"]', 'wer@qwe.com')