Giter Club home page Giter Club logo

allure-playwright-example's Introduction

Hi ๐Ÿ‘‹, I'm Yevhen

Software Development Engineer in Test

elaichenkov

  • ๐Ÿ”ญ Iโ€™m currently working on different Cypress and Playwright projects

  • ๐ŸŒฑ Iโ€™m currently learning Algorithms and data structures

  • ๐Ÿ“ I regularly write articles on https://dev.to/elaichenkov

  • ๐Ÿ’ฌ Ask me about JavaScript/TypeScript, Cypress, Playwright, WebdriverIO, Selenium

  • ๐Ÿ“ซ How to reach me [email protected]

My projects:

Name Version Downloads
cy-verify-downloads
webdriverio/wdio-wait-for
cypress-delete-downloads-folder
cypress-plugin-init
odottaa
playwright-zephyr

Blogs posts

Connect with me:

elaichenkov elaichenkov elaichenkov 11597494 elaichenkov

Languages and Tools:

bash css3 cypress docker gcp git html5 jasmine javascript jenkins jest kubernetes linux mocha mongodb mysql nodejs postgresql puppeteer selenium typescript

elaichenkov

ย elaichenkov

allure-playwright-example's People

Contributors

elaichenkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

allure-playwright-example's Issues

After running the test which fails, allure-report folder is not created

This is my package.json:

{
  "name": "test-automation",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "allure:generate": "npx allure generate ./allure-results --clean",
    "allure:open": "npx allure open ./allure-report",
    "allure:serve": "npx allure serve",
    "test": "npx playwright test --project=chromium",
    "posttest": "npm run allure:generate"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@playwright/test": "^1.18.1",
    "allure-commandline": "^2.17.2",
    "allure-playwright": "^2.0.0-beta.15",
    "playwright": "^1.18.1",
    "prettier": "2.5.1"
  }
}

When I run npm test and the test fails, I don't have allure-report folder created.
I get this weird three Y commands in the console.

image

If I do manually npm run allure:generate and afterwords npm run allure:open, then the allure-report is created and I can open the report.

This is my playwright.config.ts:

import { PlaywrightTestConfig, devices } from '@playwright/test';

/**
 * See https://playwright.dev/docs/test-configuration.
 */
const config: PlaywrightTestConfig = {
  testDir: './tests',

  /* Maximum time one test can run for. */
  timeout: 5 * 60 * 1000,

  expect: {
    /**
     * Maximum time expect() should wait for the condition to be met.
     * For example in `await expect(locator).toHaveText();`
     */
    timeout: 15000,
  },

  /* Fail the build on CI if you accidentally left test.only in the source code. */
  forbidOnly: !!process.env.CI,

  /* Retry on CI only */
  retries: process.env.CI ? 2 : 0,

  /* Opt out of parallel tests on CI. */
  workers: process.env.CI ? 1 : undefined,

  /* Reporter to use. See https://playwright.dev/docs/test-reporters */
  reporter: 'allure-playwright',

  /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
  use: {
    /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
    actionTimeout: 0,

    /* Base URL to use in actions like `await page.goto('/')`. */
    baseURL: 'https://my-app.com',

    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
    trace: 'on-first-retry',

    screenshot: 'on',

    video: 'retain-on-failure',
  },

  /* Configure projects for major browsers */
  projects: [
    {
      name: 'chromium',

      /* Project-specific settings. */
      use: {
        ...devices['Desktop Chrome'],
      },
    },

    {
      name: 'firefox',
      use: {
        ...devices['Desktop Firefox'],
      },
    },

    {
      name: 'webkit',
      use: {
        ...devices['Desktop Safari'],
      },
    },

    /* Test against mobile viewports. */
    // {
    //   name: 'Mobile Chrome',
    //   use: {
    //     ...devices['Pixel 5'],
    //   },
    // },
    // {
    //   name: 'Mobile Safari',
    //   use: {
    //     ...devices['iPhone 12'],
    //   },
    // },

    /* Test against branded browsers. */
    // {
    //   name: 'Microsoft Edge',
    //   use: {
    //     channel: 'msedge',
    //   },
    // },
    // {
    //   name: 'Google Chrome',
    //   use: {
    //     channel: 'chrome',
    //   },
    // },
  ],

  /* Folder for test artifacts such as screenshots, videos, traces, etc. */
  // outputDir: 'test-results/',

  /* Run your local dev server before starting the tests */
  // webServer: {
  //   command: 'npm run start',
  //   port: 3000,
  // },
};
export default config;

If the test passes then everything is fine.
I have to mention I have one test that I am skipping - test.skip(...)
Can you please help?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.