marmelab / greenframe-cli

Estimate the carbon footprint of a user scenario on a web application
https://greenframe.io
Other
220 stars 9 forks source link

Keywords not known #68

Open mazghari9 opened 6 months ago

mazghari9 commented 6 months ago

Hello,

I was testing greenframe-cli with the following testing script :

import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Playwright/);
});

test('get started link', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await page.getByRole('link', { name: 'Get started' }).click();
  await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});

test('Playwright Test', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Playwright/);
  const getStarted = page.getByText('Get started');
  await expect(getStarted).toHaveAttribute('href', '/docs/intro');
  await getStarted.click();
  await expect(page).toHaveURL(/.*intro/);
});

but it raised an error, since it does not recognize the test and expect keywords, even in the package.json of the greenframe-cli container the @playwright/test library.