diff --git a/packages/playwright/src/runner/reporters.ts b/packages/playwright/src/runner/reporters.ts index ac5c6212390a8..d3324a538319f 100644 --- a/packages/playwright/src/runner/reporters.ts +++ b/packages/playwright/src/runner/reporters.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +import fs from 'fs'; import { calculateSha1 } from 'playwright-core/lib/utils'; import { loadReporter } from './loadUtils'; @@ -127,6 +127,10 @@ function computeCommandHash(config: FullConfigInternal) { command.cliOnlyChanged = config.cliOnlyChanged; if (config.config.tags.length) command.tags = config.config.tags.join(' '); + if (config.cliTestList) + command.cliTestList = calculateSha1(fs.readFileSync(config.cliTestList)); + if (config.cliTestListInvert) + command.cliTestListInvert = calculateSha1(fs.readFileSync(config.cliTestListInvert)); if (Object.keys(command).length) parts.push(calculateSha1(JSON.stringify(command)).substring(0, 7)); return parts.join('-'); diff --git a/tests/playwright-test/reporter-blob.spec.ts b/tests/playwright-test/reporter-blob.spec.ts index 2cf828cec38aa..c278de2f6ea03 100644 --- a/tests/playwright-test/reporter-blob.spec.ts +++ b/tests/playwright-test/reporter-blob.spec.ts @@ -2196,6 +2196,18 @@ test('project filter in report name', async ({ runInlineTest }) => { const reportFiles = await fs.promises.readdir(reportDir); expect(reportFiles.sort()).toEqual(['report-foo-b-r-6d9d49e-1.zip']); } + + { + const result = await runInlineTest({ ...files, 'test-list.txt': `foo` }, { 'test-list': 'test-list.txt' }); + expect(result.exitCode).toBe(0); + const reportFiles = await fs.promises.readdir(reportDir); + + const result2 = await runInlineTest({ ...files, 'test-list.txt': `bar` }, { 'test-list': 'test-list.txt' }); + expect(result2.exitCode).toBe(0); + const reportFiles2 = await fs.promises.readdir(reportDir); + + expect(reportFiles2.sort()).not.toEqual(reportFiles.sort()); + } }); test('should report duration across all shards', async ({ runInlineTest, mergeReports }) => {