GithubHelp home page GithubHelp logo

jest-allure-circus's People

Contributors

c4lifa avatar c4lifasecondary avatar dependabot[bot] avatar github-actions[bot] avatar killwolfvlad avatar lpolito avatar ryparker avatar semantic-release-bot avatar smvv avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

jest-allure-circus's Issues

Question | Not clear - is it possible to add console.logs to the reporter from jest?

Question | Not clear - is it possible to add console.logs from jest and typescript?

We tried several ways, but it seems that it does not show the console.logs that are executed while the tests are running. Is this supported?

Also tried with this:

/**

  • Attach a file to the report of the current executable.
    */
    allure.attachment(
    name: string,
    content: Buffer | string,
    type: ContentType
    );

There is a mistake in types of logStep function

Here is the logStep code

logStep(
	name: string,
	status: Status,
	attachments?: Array<{name: string; content: string; type: ContentType | string | AttachmentOptions}>
): void {...}

Content should have types Buffer | string, but it has only string

Using Jest 29- after configuring allure: Test environment jest-circus-allure cannot be found. Make sure the testEnvironment configuration option points to an existing node module

Describe the bug

Using Jest 29- after configuring allure: Test environment jest-circus-allure cannot be found. Make sure the testEnvironment configuration option points to an existing node module

To Reproduce configure:

  1. npm i jest-allure-circus
  2. testRunner: "jest-circus/runner",
  3. testEnvironment: "jest-circus-allure",
  4. try to run any test

Actual behavior

Jest throws and error
` Validation Error:

Test environment jest-circus-allure cannot be found. Make sure the testEnvironment configuration option points to an existing node module.

Configuration Documentation:
https://jestjs.io/docs/configuration`

Expected behavior

You can run tests and allure without issues

Screenshots

image

Jest version: "ts-jest": "^29.0.3"
allure version: "jest-allure-circus": "^1.0.21",

Failed tests are ugly because text has ANSI escape codes

Describe the bug

Failed tests are ugly because text has ANSI escape codes.

To Reproduce

Create simple test:

describe("Simple Test", () => {
  it("must parse docblock", () => {
    /** My test description.
     * @epic Implement addition functionality
     * @tag Accounting
     */

    expect(1).toBe(2);
  });
});

Expected behavior

Error description doesn't contain ANSI escape codes.

Screenshots

Actual result:

image

Expected result:

image

Additional context

I have this jest packages:

  • "jest": "28.1.3"
  • "jest-allure-circus": "1.0.15"
  • "jest-extended": "3.0.1"
  • "ts-jest": "28.0.7"

TypeError: Cannot read properties of undefined (reading 'call')

Describe the bug

I have this error when running tests.

To Reproduce

My jest config in package.json

{
  "jest": {
    "moduleFileExtensions": [
      "ts",
      "js"
    ],
    "resetMocks": true,
    "rootDir": "./",
    "roots": [
      "<rootDir>/src",
      "<rootDir>/test"
    ],
    "setupFilesAfterEnv": [
      "jest-extended/all"
    ],
    "testEnvironment": "jest-allure-circus",
    "testEnvironmentOptions": {
      "jiraUrl": "https://jira.example.com/browse/"
    },
    "testRegex": ".*\\.spec\\.ts$",
    "testTimeout": 30000,
    "transform": {
      "^.+\\.ts$": "ts-jest"
    }
  }
}

Expected behavior

Tests run without errors.

Screenshots

image

Additional context

I have this jest packages:

  • "jest": "28.1.3"
  • "jest-allure-circus": "1.0.15"
  • "jest-extended": "3.0.1"
  • "ts-jest": "28.0.7"

Impossible to use wait-for-expect package

Describe the bug

Test fails when code contains waitForExpect statement.

To Reproduce

Create test:

import waitForExpect from "wait-for-expect";

describe("test", () => {
  it("test", async () => {
    await waitForExpect(() => {
      console.log(1);
    });
  });
});

Expected behavior

Test runs without errors.

Screenshots

image

Additional context

I have this jest packages:

  • "jest": "28.1.3"
  • "jest-allure-circus": "1.0.17"
  • "jest-extended": "3.0.1"
  • "ts-jest": "28.0.7"

Is it possible to integrate it with jest-playwright-preset?

I'm using jest-playwright-preset to run playwright tests with the jest.
https://www.npmjs.com/package/jest-playwright-preset

But it has note in documentation:

Be sure to remove any existing testEnvironment option from your Jest configuration. The jest-playwright-preset preset needs to manage that option itself.

With jasmine2 reporter I used jest-allure which has different way to setup:
setupFilesAfterEnv: ["jest-allure/dist/setup"]

So is there any over options to setup allure reporter?

docblock pragmas doesn't exists in allure results

Describe the bug

docblock pragmas doesn't exists in allure results.

To Reproduce

Create simple test:

describe("Simple Test", () => {
  it("must parse docblock", () => {
    /** My test description.
     * @epic Implement addition functionality
     * @tag Accounting
     */

    expect(1).toBe(1);
  });
});

Expected behavior

Test in allure results have epic and tag.

Screenshots

Actual result:

image

Expected result:

image

Additional context

I have this jest packages:

  • "jest": "28.1.3"
  • "jest-allure-circus": "1.0.15"
  • "jest-extended": "3.0.1"
  • "ts-jest": "28.0.7"

Add Support for Puppeteer + Jest Circus

Hello, could you please add a support for Allure + Circus + Puppeteer? I mean need an additional node which will include puppeteer setup.

example of puppeteer setup


const fs = require('fs');
const os = require('os');
const path = require('path');

const chalk = require('chalk');
const NodeEnvironment = require('jest-environment-node');
const puppeteer = require('puppeteer-core');

const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');

class PuppeteerEnvironment extends NodeEnvironment {
  constructor(config) {
    super(config);
  }

  async setup() {
    await super.setup();
    const wsEndpoint = fs.readFileSync(path.join(DIR, 'wsEndpoint'), 'utf8');

    if (!wsEndpoint) {
      throw new Error('wsEndpoint not found');
    }

    this.global.__BROWSER__ = await puppeteer.connect({
      browserWSEndpoint: wsEndpoint,
      defaultViewport: process.env.HEADLESS === 'true' ? { width: 1700, height: 1200 } : null,
    });
  }

  async teardown() {
    await super.teardown();
  }

  runScript(script) {
    return super.runScript(script);
  }
}

module.exports = PuppeteerEnvironment;

Choose package manager

This repo contains both lock files from Yarn v1 (Classic) and npm <= 6.

I think we must choose one package manager and leave one lock file.

I suggest use Yarn Modern (v4 canary with a lot of improvements, see our template https://github.com/Byndyusoft/node-typescript-template as example). We successfully use it in public and private projects.

If you prefer npm, can you use npm v8 and update lock file to v2?

P.S. Impossible to use dependabot with Yarn Modern (see dependabot/dependabot-core#1297 for more details), but we always can use Renovate which is better than dependabot.

Missing clear guidelines on adding allure types in jest >29 - now its not working

Describe the bug

We dont have jest.setup.js only jest.config.js
Therefor we can't use the allure API, since we get error "error TS2304: Cannot find name 'allure'."

Whats configured?
// The test environment that will be used for testing
testEnvironment: 'jest-allure-circus',
// This option allows use of a custom test runner
'testRunner': 'jest-circus/runner',

Expected behavior

Guideline on configuring allure with TS

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.