Closed vrknetha closed 3 years ago
Hi, could you provide us the JavaScript file where you use Playwright? Including options etc.
tsconfig.test.json
{
"extends": "./tsconfig.json",
"types": ["jest", "node", "jest-playwright-preset", "expect-playwright"],
"compilerOptions": {
"esModuleInterop": true
}
}
jest-config.js
module.exports = {
verbose: true,
globals: {
'ts-jest': {
tsConfig: './tsconfig.test.json'
}
},
preset: 'jest-playwright-preset',
transform: {
'^.+\\.ts$': 'ts-jest'
},
testMatch: ['**/playwright/e2e/**/*.test.ts'],
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: './test-reports',
outputName: 'results.xml',
usePathForSuiteName: true,
classNameTemplate: '{classname}-{title}',
titleTemplate: '{classname}-{title}'
}
],
['@vrknetha/jest-testrail', {project_id: '1', suite_id: '1'}]
],
testRunner: 'jest-circus/runner',
testEnvironment: './customEnvironment.ts',
testTimeout: 100000,
setupFilesAfterEnv: ['expect-playwright']
};
jest-playwright.config.js
// https://github.com/mmarkelov/jest-playwright/#configuration
module.exports = {
launchOptions: {
headless: true,
ignoreDefaultArgs: ['--disable-extensions'],
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--ignore-certificate-errors',
'--unsafely-treat-insecure-origin-as-secure=https://localhost:4200/',
'--disable-notifications'
]
},
contextOptions: {
ignoreHTTPSErrors: true,
viewport: {
width: 1024,
height: 768
}
},
browsers: ['chromium'],
collectCoverage: false
};
test-case
import FacebookUtilities from '../../utils/facebookUtilities';
import ManageGroupsPage from '../../pages/manageGroupsPage';
import deleteUser from '../../utils/database.adapter';
import {userWithSingleGroup, baseUrl} from '../../utils/credentials';
import {Page} from 'playwright';
describe('User Onboarding 2.0', () => {
let groupUrl: string;
let isGroupInstalled: boolean = false;
const facebookUtilities: FacebookUtilities = new FacebookUtilities(page, context);
const manageGroupsPage: ManageGroupsPage = new ManageGroupsPage(page, context);
test('C9 : Verify when user logged into Convosight first time with Groups as Admin', async () => {
//Arrange
await page.goto(baseUrl);
//Act
await expect(page).toHaveSelector(facebookUtilities.BtnLogin);
await facebookUtilities.login(userWithSingleGroup.username, userWithSingleGroup.password);
await expect(page).toHaveSelector(facebookUtilities.BtnProfileContinue);
await facebookUtilities.profilePopupClickContinue();
await expect(page).toHaveSelector(facebookUtilities.BtnGroupsOk);
await facebookUtilities.groupsPageClickOnOk();
await manageGroupsPage.init();
//Assert
const title = await page.title();
await expect(title).toEqual('Group Admin Manage Groups');
await expect(page).toEqualText(manageGroupsPage.EleGroupsPopupTitle, 'Add app to your groups');
groupUrl = await manageGroupsPage.getAppGroupUrl();
const page2: Page = await context.newPage();
const fbUtilities: FacebookUtilities = new FacebookUtilities(page2, context);
await fbUtilities.completeGroupInstallation(groupUrl);
await page2.close();
isGroupInstalled = true;
await manageGroupsPage.completeGroupSurvey();
await expect(page).toHaveSelector(manageGroupsPage.EleAnalyzeButton);
});
afterAll(async function () {
if (isGroupInstalled) await facebookUtilities.completeGroupUninstallation(groupUrl);
await facebookUtilities.deleteConvosightPermission();
await deleteUser(userWithSingleGroup.username);
await page.close();
await browser.close();
});
});
@vrknetha we were out of ideas here and the discussion stalled. What's the status of this now? Is this still relevant?
Closing since we cannot reproduce the issue.
Context:
The chromium fails to connect in the CI, We have used all same dependencies mentioned in the playwright docker. I am attaching the logs. Initially, we thought it's due to memory and we have bumped up to 8gb but still, it's failing.
Code Snippet