Skip to content

Commit 9c6ec25

Browse files
authored
fix: display error details even if test has successful assertView results and fix e2e tests (#516)
* fix: display error details even if test has successful assertView results * test: fix e2e tests
1 parent ee9d0f4 commit 9c6ec25

File tree

33 files changed

+66
-17
lines changed

33 files changed

+66
-17
lines changed

lib/static/components/icons/view-in-browser/index.styl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
display: inline-block;
33
width: 16px;
44
height: 19px;
5-
vertical-align: middle;
65
margin-left: 4px;
76
margin-right: 0;
87
padding: 0 2px;

lib/static/components/section/body/tabs.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class Tabs extends Component {
1111
id: PropTypes.string.isRequired,
1212
status: PropTypes.string.isRequired,
1313
imageIds: PropTypes.array.isRequired,
14-
multipleTabs: PropTypes.bool.isRequired,
1514
screenshot: PropTypes.bool.isRequired,
1615
error: PropTypes.object
1716
}).isRequired
@@ -20,7 +19,7 @@ class Tabs extends Component {
2019
_shouldAddErrorTab() {
2120
const {result} = this.props;
2221

23-
return result.multipleTabs && isErrorStatus(result.status) && !result.screenshot;
22+
return isErrorStatus(result.status);
2423
}
2524

2625
_drawTab({key, imageId = null}) {

lib/static/styles.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
.report {
2323
font: 15px YS Text, Helvetica Neue, Arial, sans-serif;
24-
line-height: 20px;
24+
line-height: 15px;
2525
margin-bottom: 15px;
2626
}
2727

@@ -320,7 +320,7 @@ main.container {
320320

321321
.section__body .section__title {
322322
font-size: 15px;
323-
line-height: 20px;
323+
line-height: 15px;
324324
}
325325

326326
.section__body .section__title.section__title_type_browser {
@@ -335,7 +335,7 @@ main.container {
335335
.sticky-header__wrap:before {
336336
content: '';
337337
width: 18px;
338-
height: 16px;
338+
height: 18px;
339339
display: inline-block;
340340
margin-right: 5px;
341341
vertical-align: middle;

test/func/common.hermione.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports.getCommonConfig = (projectDir) => ({
1313
desiredCapabilities: {
1414
browserName: 'chrome',
1515
'goog:chromeOptions': {
16-
args: ['headless', 'no-sandbox'],
16+
args: ['headless', 'no-sandbox', 'hide-scrollbars'],
1717
binary: CHROME_BINARY_PATH
1818
}
1919
},
Binary file not shown.

test/func/fixtures/hermione/failed-describe.hermione.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ describe('failed describe', function() {
2121
throw new Error(`long_error_message ${'0123456789'.repeat(20)}\n message content`);
2222
});
2323

24+
it('test with successful assertView and error', async ({browser}) => {
25+
await browser.url(browser.options.baseUrl);
26+
27+
await browser.assertView('header', 'header');
28+
29+
throw new Error('Some error');
30+
});
31+
2432
it.skip('test skipped', async ({browser}) => {
2533
await browser.url(browser.options.baseUrl);
2634
});
2.83 KB
Loading

test/func/fixtures/playwright/tests/failed-describe.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ test.describe('failed describe', () => {
3434
test.skip(true, 'foo-bar');
3535
});
3636

37+
test('test with successful assertView and error', async ({page, baseURL}) => {
38+
await page.goto(baseURL as string);
39+
40+
await expect(page.locator('header')).toHaveScreenshot('header-success.png');
41+
42+
throw new Error('Some error');
43+
});
44+
3745
test.skip('test skipped', async ({page, baseURL}) => {
3846
await page.goto(baseURL as string);
3947
});
3.87 KB
Loading

0 commit comments

Comments
 (0)