facebook/memlab

Invalid scenario file

jdelbarcogarza-softtek opened this issue · 8 comments

``Hello, I'm trying to test memlab for a project. While following the tutorial it worked, but now when trying to run a scenario in my project. The error Invalid scenario file: .\tests\test.js comes up. Context: I placed the `scenario.js` file inside `/src/test` folders.

Here is my scenario:


module.exports = {
    url: () => "http://localhost:5173/apps/music%20app/",
    action: async () => {
        // enter requests route by clicking link
        const elements = await page.$x(
            "//a[contains(., 'Requests')]"
        )

        if (elements.length > 0) {
            const [a] = elements;
            await a.click();

            // Clean up external references from memlab
            await Promise.all(elements.map((e) => e.dispose()));
        } else {
            console.log("No matching elements found.");
        }
    },
    back: async () => await page.click("a[contains(., 'Dashboard')]"),
};

Could someone put me in the right direction here on how to get memlab up and running?

Update: when the file is extracted from the project's folder, memlab works. But should memlab be able to run code inside the project's codebase?

The scenario file doesn't define page function parameter for action and back, not sure why it works when it is outside the project's codebase