Skip to content

Commit

Permalink
Revert "Chore: Collect e2e coverage (#25743)" (#25936)
Browse files Browse the repository at this point in the history
This reverts commit e43d0d2.
  • Loading branch information
souzaramon committed Jun 20, 2022
1 parent e43d0d2 commit 668e6d4
Show file tree
Hide file tree
Showing 25 changed files with 36 additions and 351 deletions.
31 changes: 6 additions & 25 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ jobs:
done
cd ./apps/meteor
npm run test:e2e
npm run test:playwright
- name: Store playwright test trace
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -640,12 +640,12 @@ jobs:
done;
exit $s
- name: 🎭 Install Playwright
- name: Install Playwright
run: |
cd ./apps/meteor
npx playwright install --with-deps
- name: 🎭 E2E Test UI
- name: E2E Test UI
run: |
echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc
Xvfb -screen 0 1024x768x24 :99 &
Expand Down Expand Up @@ -685,32 +685,13 @@ jobs:
docker logs presence --tail=50
cd ./apps/meteor
npm run test:e2e:ee
- name: 🎭 Extract e2e:coverage
run: |
NYC_OUTPUT=$(yarn test:e2e:nyc)
COVERAGE_REPORTS=$(grep -o '[^ ]*%' <<< "$NYC_OUTPUT")
echo "REPORT_STATEMENTS=$(sed -n 1p <<< "$COVERAGE_REPORTS")" >> $GITHUB_ENV
- name: 🎭 Publish e2e:coverage badge
uses: RocketChat/ghpages-dynamic-badges-action@v1.0.0
with:
label: "e2e:coverage"
message: "${{ env.REPORT_STATEMENTS }}"
target_folder: "./apps/meteor/tests/coverage-badges"
npm run test:playwright
- name: 🎭 Store ee-playwright-coverage
uses: actions/upload-artifact@v2
with:
name: ee-playwright-coverage
path: ./apps/meteor/coverage

- name: 🎭 Store ee-playwright-test-trace
- name: Store playwright test trace
uses: actions/upload-artifact@v2
if: failure()
with:
name: ee-playwright-test-trace
name: playwright-test-trace
path: ./apps/meteor/tests/e2e/test-failures*

deploy:
Expand Down
3 changes: 0 additions & 3 deletions apps/meteor/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"babel-plugin-istanbul"
]
}
7 changes: 1 addition & 6 deletions apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
"typecheck": "cross-env NODE_OPTIONS=\"--max-old-space-size=8184\" tsc --noEmit --skipLibCheck",
"deploy": "npm run build && pm2 startOrRestart pm2.json",
"coverage": "nyc -r html mocha --config ./.mocharc.js",
"testci": "node .scripts/start.js",
"test:e2e": "playwright test",
"test:e2e:ee": "cross-env ENTERPRISE=true E2E_COVERAGE=true yarn test:playwright",
"test:e2e:nyc": "nyc report --reporter=text-summary --reporter=lcov",
"test:playwright": "playwright test",
"testapi": "mocha --config ./.mocharc.api.js",
"testunit": "npm run .testunit:definition && npm run .testunit:client && npm run .testunit:server",
".testunit:server": "mocha --config ./.mocharc.js",
Expand Down Expand Up @@ -144,7 +141,6 @@
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.5",
"babel-plugin-array-includes": "^2.0.3",
"babel-plugin-istanbul": "^6.1.1",
"chai": "^4.3.6",
"chai-datetime": "^1.8.0",
"chai-dom": "^1.11.0",
Expand All @@ -163,7 +159,6 @@
"jsdom-global": "^3.0.2",
"mocha": "^9.2.2",
"mock-require": "^3.0.3",
"nyc": "^15.1.0",
"outdent": "~0.8.0",
"pino-pretty": "^7.6.1",
"postcss": "~8.4.12",
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const config: PlaywrightTestConfig = {
screenshot: 'only-on-failure',
trace: 'retain-on-failure',
baseURL,
browserName: 'chromium',
},
outputDir: 'tests/e2e/test-failures',
reporter: [['list']],
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/tests/e2e/00-wizard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test, expect } from './utils/test';
import { test, expect } from '@playwright/test';

import { VALID_EMAIL, adminLogin } from './utils/mocks/userAndPasswordMock';
import { setupWizardStepRegex } from './utils/mocks/urlMock';
import { HOME_SELECTOR } from './utils/mocks/waitSelectorsMock';
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/tests/e2e/01-forgot-password.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test, expect } from './utils/test';
import { test, expect } from '@playwright/test';

import { Global, LoginPage } from './pageobjects';
import { VALID_EMAIL, INVALID_EMAIL, INVALID_EMAIL_WITHOUT_MAIL_PROVIDER } from './utils/mocks/userAndPasswordMock';

Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/tests/e2e/02-register.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test } from './utils/test';
import { test } from '@playwright/test';

import { registerUser, WRONG_PASSWORD } from './utils/mocks/userAndPasswordMock';
import { LoginPage } from './pageobjects';

Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/tests/e2e/03-login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test, expect } from './utils/test';
import { test, expect } from '@playwright/test';

import { validUser } from './utils/mocks/userAndPasswordMock';
import { Global, LoginPage } from './pageobjects';
import { HOME_SELECTOR } from './utils/mocks/waitSelectorsMock';
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/tests/e2e/04-main-elements-render.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test, expect } from './utils/test';
import { test, expect } from '@playwright/test';

import { LoginPage, FlexTab, SideNav, MainContent } from './pageobjects';
import { adminLogin } from './utils/mocks/userAndPasswordMock';

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/tests/e2e/05-channel-creation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from '@playwright/test';
import { faker } from '@faker-js/faker';

import { test } from './utils/test';
import { LoginPage, ChannelCreation } from './pageobjects';
import { validUserInserted, ROCKET_CAT } from './utils/mocks/userAndPasswordMock';

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/e2e/06-messaging.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Browser } from '@playwright/test';
import { expect, test, Browser } from '@playwright/test';

import { expect, test } from './utils/test';
import { FlexTab, MainContent, SideNav, LoginPage } from './pageobjects';
import { adminLogin, validUserInserted } from './utils/mocks/userAndPasswordMock';

Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/tests/e2e/07-emoji.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test, expect } from './utils/test';
import { test, expect } from '@playwright/test';

import { SideNav, MainContent, LoginPage } from './pageobjects';
import { adminLogin } from './utils/mocks/userAndPasswordMock';

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/e2e/08-resolutions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Browser } from '@playwright/test';
import { test, expect, Browser } from '@playwright/test';

import { expect, test } from './utils/test';
import { Global, MainContent, SideNav, LoginPage } from './pageobjects';
import { adminLogin } from './utils/mocks/userAndPasswordMock';

Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/tests/e2e/09-channel.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test, expect } from './utils/test';
import { test, expect } from '@playwright/test';

import { Global, FlexTab, MainContent, SideNav, LoginPage } from './pageobjects';
import { adminLogin } from './utils/mocks/userAndPasswordMock';
import { LOCALHOST } from './utils/mocks/urlMock';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/tests/e2e/10-user-preferences.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import faker from '@faker-js/faker';

import { test, expect } from './utils/test';
import { PreferencesMainContent, MainContent, SideNav, LoginPage, FlexTab } from './pageobjects';
import { adminLogin } from './utils/mocks/userAndPasswordMock';
import { clearMessages } from './utils/helpers/clearMessages';
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/tests/e2e/11-admin.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { test, expect } from './utils/test';
import { test, expect } from '@playwright/test';

import { adminLogin, ROCKET_CAT } from './utils/mocks/userAndPasswordMock';
import { FlexTab, Administration, LoginPage, SideNav } from './pageobjects';
import { ROCKET_CAT_SELECTOR } from './utils/mocks/waitSelectorsMock';
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/e2e/12-settings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Page } from '@playwright/test';
import { test, expect, Page } from '@playwright/test';
import { v4 as uuid } from 'uuid';

import { expect, test } from './utils/test';
import { BASE_API_URL } from './utils/mocks/urlMock';
import { adminLogin, validUserInserted, registerUser } from './utils/mocks/userAndPasswordMock';
import { LoginPage, MainContent, SideNav, Administration, PreferencesMainContent } from './pageobjects';
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/e2e/13-permissions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Page } from '@playwright/test';
import { Page, test, expect } from '@playwright/test';
import { v4 as uuid } from 'uuid';

import { expect, test } from './utils/test';
import { LoginPage, FlexTab, Administration, MainContent, SideNav } from './pageobjects';
import { adminLogin, createRegisterUser } from './utils/mocks/userAndPasswordMock';
import { BACKSPACE } from './utils/mocks/keyboardKeyMock';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/tests/e2e/14-setting-permissions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import faker from '@faker-js/faker';

import { test, expect } from './utils/test';
import { adminLogin, validUserInserted } from './utils/mocks/userAndPasswordMock';
import { SideNav, Administration, LoginPage } from './pageobjects';

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/e2e/15-message-popup.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Page } from '@playwright/test';
import { Page, test, expect } from '@playwright/test';

import { expect, test } from './utils/test';
import { adminLogin } from './utils/mocks/userAndPasswordMock';
import { userMock } from './utils/mocks/userMock';
import { LoginPage, MainContent, SideNav } from './pageobjects';
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/e2e/16-discussion.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Page } from '@playwright/test';
import { test, Page } from '@playwright/test';
import { faker } from '@faker-js/faker';
import { v4 as uuid } from 'uuid';

import { test } from './utils/test';
import { MainContent, Discussion, LoginPage, SideNav } from './pageobjects';
import { adminLogin } from './utils/mocks/userAndPasswordMock';

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/e2e/omnichannel-agents.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Page } from '@playwright/test';
import { test, expect, Page } from '@playwright/test';

import { expect, test } from './utils/test';
import { adminLogin } from './utils/mocks/userAndPasswordMock';
import { LoginPage, SideNav, Agents, Global } from './pageobjects';

Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/e2e/omnichannel-departaments.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Page } from '@playwright/test';
import { test, Page, expect } from '@playwright/test';

import { expect, test } from './utils/test';
import { Departments, SideNav, Global, LoginPage } from './pageobjects';
import { adminLogin } from './utils/mocks/userAndPasswordMock';

Expand Down
41 changes: 0 additions & 41 deletions apps/meteor/tests/e2e/utils/test.ts

This file was deleted.

Loading

0 comments on commit 668e6d4

Please sign in to comment.