Rayrun
← Back to Discord Forum

Help with implementing new MergeExpect and MergeTest features

andyspickleposted in #help-playwright
Open in Discord

Hi all

I am having trouble implementing the new feature to create and merge multiple custom tests/expects.

I have followed the examples in the documentation and whenever I try and run the tests I am seeing the following error message

SyntaxError: The requested module '@playwright/test' does not provide an export named 'mergeExpects'

fixture.ts

import { mergeExpects, mergeTests } from '@playwright/test';
import { test as baseTest, expect as baseExpect } from './base.js';
import { test as axeTest } from './axe-test.js';
import { test as pageObjectsTest } from './page-objects.js';

export const test = mergeTests(baseTest, pageObjectsTest);// , axeTest);
export const expect = mergeExpects(baseExpect);

I assume it has something to do with the way the project is set up (ESM)

This thread is trying to answer question "Why am I encountering a SyntaxError when trying to implement the new feature to create and merge multiple custom tests/expects in '@playwright/test'?"

6 replies

npx playwright --version is ^1.39 ?

debbieobrien
debbieobrien

perhaps remove node modules and then run npm i and see if that helps. your code looks fine so its somehow not picking it up

debbieobrien
debbieobrien

that message you are seeing is correct if you are on a previous version but you seem to be on the correct version so thats why i am guessing node modules / package lock issue

@skorp32: Thanks for this info, I swear I tried to search GitHub to see if there were similar issues.

Thanks for this info, I swear I tried to search GitHub to see if there were similar issues.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].