Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E - DONT MERGE #8861

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
strategy:
fail-fast: false
matrix:
cmd: ['ci-webdriver-standard', 'ci-e2e-integration', 'ci-webdriver-default-mobile']
cmd: ['ci-webdriver-default-mobile']
suite: [all]
include:
- cmd: ci-webdriver-default
Expand Down
7 changes: 1 addition & 6 deletions tests/e2e/default-mobile/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ const MOBILE_CHROME_VERSION = '118.0.5993.112';
exports.config = Object.assign(wdioBaseConfig.config, {
suites: {
all: [
'./**/*.wdio-spec.js',
[
'../default/login/login-logout.wdio-spec.js',
'../default/navigation/navigation.wdio-spec.js',
'../default/navigation/hamburger-menu.wdio-spec.js',
],
'contacts/barcode-search-contacts.wdio-spec.js',
]
},
beforeSuite: async () => {
Expand Down
21 changes: 0 additions & 21 deletions tests/e2e/default/suites.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
const SUITES = {
core: [
'./admin/**/*.wdio-spec.js',
'./login/**/*.wdio-spec.js',
'./translations/**/*.wdio-spec.js',
'./more-options-menu/**/*.wdio-spec.js',
'./users/**/*.wdio-spec.js',
'./about/**/*.wdio-spec.js',
'./navigation/**/*.wdio-spec.js',
'./privacy-policy/**/*.wdio-spec.js',
],
workflows: [
'./analytics/**/*.wdio-spec.js',
'./contacts/**/*.wdio-spec.js',
'./reports/**/*.wdio-spec.js',
'./targets/**/*.wdio-spec.js',
'./tasks/**/*.wdio-spec.js',
'./sms/**/*.wdio-spec.js',
],
data: [
'./db/**/*.wdio-spec.js',
'./purge/**/*.wdio-spec.js',
'./telemetry/**/*.wdio-spec.js'
],
lowLevel: [
'./pwa/**/*.wdio-spec.js',
'./service-worker/**/*.wdio-spec.js',
'./transitions/**/*.wdio-spec.js'
],
enketo: [
'./enketo/**/*.wdio-spec.js',
]};

exports.suites = SUITES;
Expand Down
4 changes: 1 addition & 3 deletions tests/e2e/default/wdio.conf.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
const wdioBaseConfig = require('../wdio.conf');
const { suites } = require('./suites');

// Override specific properties from wdio base config
const defaultConfig = Object.assign(wdioBaseConfig.config, {
suites,
specs: ['**/*.wdio-spec.js'],
specs: [],
});

exports.config = defaultConfig;
1 change: 0 additions & 1 deletion tests/e2e/standard/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ chai.use(require('chai-exclude'));
const standardConfig = Object.assign(wdioBaseConfig.config, {
suites: {
all: [
'./**/*.wdio-spec.js'
]
},

Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/upgrade/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ const servicesStartTimeout = () => {
const upgradeConfig = Object.assign(wdioBaseConfig.config, {
specs:
[
'upgrade.wdio-spec.js',
'*.wdio-spec.js'
],
exclude: [],

Expand Down
9 changes: 8 additions & 1 deletion tests/page-objects/default-mobile/search/search.wdio.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ const performBarcodeSearch = async (barcodeImagePath) => {
// then we need to manipulate the DOM of the respective element to make it interactable.
await browser.pause(2000);
await browser.execute(function () {
document.getElementsByClassName('barcode-scanner-input')[0].style.display = 'block';
const elements = document.getElementsByClassName('barcode-scanner-input');
if (elements[0]?.style?.display) {
console.warn('TESTING!!!!!- input found');
elements[0].style.display = 'block';
} else {
console.warn('TESTING!!!!!- input not found');
}

});
await (await barcodeSearchInput()).setValue(barcodeImagePath);
// await browser.pause(2000);
Expand Down
6 changes: 5 additions & 1 deletion webapp/src/ts/components/search-bar/search-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,21 @@ export class SearchBarComponent implements AfterContentInit, AfterViewInit, OnDe
}

private async canShowBarcodeScanner() {
console.warn('TESTING!!!!!- !this.showBarcodeScanner', !this.showBarcodeScanner);
if (!this.showBarcodeScanner) {
return false;
}

const canUseBarcodeScanner = !this.sessionService.isAdmin() && await this.authService.has(CAN_USE_BARCODE_SCANNER);
console.warn('TESTING!!!!!- !canUseBarcodeScanner', canUseBarcodeScanner);
if (!canUseBarcodeScanner) {
return false;
}

this.barcodeTypes = await this.windowRef.BarcodeDetector?.getSupportedFormats();

console.warn('TESTING!!!!!- !(\'BarcodeDetector\' in this.windowRef)', !('BarcodeDetector' in this.windowRef));
console.warn('TESTING!!!!!- !this.barcodeTypes?.length', !this.barcodeTypes?.length);
console.warn('TESTING!!!!!- isDesktopUserAgent', this.browserDetectorService.isDesktopUserAgent());
if (
!('BarcodeDetector' in this.windowRef)
|| !this.barcodeTypes?.length
Expand Down
1 change: 1 addition & 0 deletions webapp/src/ts/services/browser-detector.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class BrowserDetectorService {
}

isDesktopUserAgent() {
console.warn('TESTING!!!!!- isDesktopUserAgent', this.parser.getPlatformType(true));
return this.parser.getPlatformType(true) === 'desktop';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BarcodeDetector {
detect() {}
}

describe('Search Bar Component', () => {
xdescribe('Search Bar Component', () => {
let component: SearchBarComponent;
let fixture: ComponentFixture<SearchBarComponent>;
let store: MockStore;
Expand Down
2 changes: 1 addition & 1 deletion webapp/tests/mocha/unit/testingtests/e2e/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('Test utils', () => {
});
});

it('Check that all test specs belong to a test suites', async () => {
xit('Check that all test specs belong to a test suites', async () => {
const pathToDefaultTesting = path.resolve(__dirname, '../../../../../../tests/e2e/default');
sinon.stub(sentinelUtils, 'skipToSeq');
const suiteSpecs = [];
Expand Down
Loading