Skip to content

Commit e10813a

Browse files
authored
chore(integration-tests): use shorter filenames for windows @W-19134917 (#5553)
* test(integration): disable flaky tests (temporarily) * chore(integration-tests): remove leading `test-` from filenames It's implicit in the files being in the test directory and long filenames cause problems on windows * chore(integration-tests): `delegate-focus-` -> `delegates-focus-` * chore(integration-tests): rename `tab-index-` to `tabindex-` * chore(integration-tests): remove `-elements` * chore(integration-tests): rename `previous-` to `prev-` * test(integration-tests): await async method * chore(integration-tests): fully remove `test-` prefix * test(integration-tests): derive test names instead of hard-coding easier to maintain and uncovered a few broken tests! * chore(integration-tests): rename way-too-long test name
1 parent a12ccc3 commit e10813a

File tree

335 files changed

+345
-378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+345
-378
lines changed

packages/@lwc/integration-tests/README.md

Lines changed: 3 additions & 3 deletions

packages/@lwc/integration-tests/scripts/build.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const engineModeFile = require.resolve('@lwc/engine-dom/dist/index.js');
2020
const shadowModeFile = require.resolve('@lwc/synthetic-shadow/dist/index.js');
2121

2222
const testSufix = '.test.js';
23-
const testPrefix = 'test-';
2423

2524
const functionalTestDir = path.join(__dirname, '../', 'src/components');
2625
const functionalTests = fs.readdirSync(functionalTestDir);
@@ -39,9 +38,7 @@ const testEntries = functionalTests.reduce((seed, functionalFolder) => {
3938
// -- Plugins & Helpers -------------------------------------
4039

4140
function getTestName(absPpath) {
42-
return path
43-
.basename(absPpath.replace(testPrefix, '').replace(testSufix, '.js'), '.js')
44-
.replace(testPrefix, '');
41+
return path.basename(absPpath.replace(testSufix, '.js'), '.js');
4542
}
4643

4744
function entryPointResolverPlugin() {

packages/@lwc/integration-tests/scripts/wdio.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const suiteFolders = path.resolve(__dirname, '../', 'src/components');
2626
const suites = fs.readdirSync(suiteFolders).map((suiteName) => {
2727
const suitePath = path.resolve(suiteFolders, suiteName);
2828
const specs = fs.readdirSync(suitePath).map((specFolderName) => {
29-
const testBasePath = path.basename(specFolderName).replace('test-', '');
29+
const testBasePath = path.basename(specFolderName);
3030
return {
3131
mount: `/${testBasePath}`,
3232
path: `./public/${suiteName}/${testBasePath}`,
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77
const assert = require('assert');
8-
describe('Delegates focus', () => {
9-
const URL = '/delegate-focus-click-input-in-negative-tabindex';
8+
const { basename } = require('node:path');
9+
const TEST_NAME = basename(__filename, '.spec.js');
1010

11+
describe('Delegates focus', () => {
1112
before(async () => {
12-
await browser.url(URL);
13+
await browser.url('/' + TEST_NAME);
1314
});
1415

1516
it('should focus the input when clicked', async () => {
1617
await browser.keys(['Tab']); // focus first anchor
1718
const input = await browser.shadowDeep$(
18-
'integration-delegate-focus-click-input-in-negative-tabindex',
19+
`integration-${TEST_NAME}`,
1920
'integration-child',
2021
'input'
2122
);
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,25 @@
44
* SPDX-License-Identifier: MIT
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
7-
describe('Tabbing into custom element with delegates focus', () => {
8-
const URL = '/delegates-focus-click-shadow-input-negative-tab-index';
7+
const { basename } = require('node:path');
8+
const TEST_NAME = basename(__filename, '.spec.js');
99

10+
describe('Tabbing into custom element with delegates focus', () => {
1011
before(async () => {
11-
await browser.url(URL);
12+
await browser.url('/' + TEST_NAME);
1213
});
1314

1415
it('should apply focus to input in shadow', async () => {
15-
const div = await browser.shadowDeep$(
16-
'integration-delegates-focus-click-shadow-input-negative-tab-index',
17-
'.selectable-div'
18-
);
16+
const div = await browser.shadowDeep$(`integration-${TEST_NAME}`, '.selectable-div');
1917
await div.click();
2018
const input = await browser.shadowDeep$(
21-
'integration-delegates-focus-click-shadow-input-negative-tab-index',
19+
`integration-${TEST_NAME}`,
2220
'integration-child',
23-
'.negative-tab-index-input'
21+
'.negative-tabindex-input'
2422
);
2523
await input.click();
2624
// browser.click('.selectable-div');
27-
// browser.click('.negative-tab-index-input');
25+
// browser.click('.negative-tabindex-input');
2826
await browser.waitUntil(
2927
async () => {
3028
const active = await browser.activeElementShadowDeep();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<template>
2+
<input class="negative-tabindex-input" type="text" tabindex="-1" />
3+
<span tabindex="0">Span</span>
4+
</template>

0 commit comments

Comments
 (0)