Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation Warning: 'tryTo'/'retryTo' is present though the plugins are not set in config #4855

Open
mirao opened this issue Feb 13, 2025 · 3 comments
Assignees

Comments

@mirao
Copy link
Contributor

mirao commented Feb 13, 2025

mirao@jobr:~/workspace/my$ codeceptjs run
Deprecation Warning: 'tryTo' has been moved to the 'codeceptjs/effects' module. Disable tryTo plugin to remove this warning.
Deprecation Warning: 'retryTo' has been moved to the 'codeceptjs/effects' module. Disable retryTo plugin to remove this warning.
CodeceptJS v3.7.2 #StandWithUkraine
Using test root "/home/mirao/workspace/my"

My --
  ✔ test something in 582ms

  OK  | 1 passed   // 938ms

Test

Feature('My');

Scenario('test something',  ({ I }) => {
    I.amOnPage('https://www.google.com');
    I.see('Google');
});

TS config

import { setHeadlessWhen, setCommonPlugins } from '@codeceptjs/configure';
// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);

// enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins
setCommonPlugins();

export const config: CodeceptJS.MainConfig = {
  tests: './*_test.ts',
  output: './output',
  helpers: {
    Playwright: {
      browser: 'chromium',
      url: 'http://localhost',
      show: true
    }
  },
  include: {
    I: './steps_file'
  },
  name: 'my'
}

Used SW:

  • CodeceptJS 3.7.2
  • Playwright 1.50.1
  • NodeJS 22
  • Ubuntu 24.04
@djyarber
Copy link

djyarber commented Feb 14, 2025

Oh, that's interesting, CodeceptJS 3.7 introduced codeceptjs/effects (link)!

Which is supposed to move tryTo and retryTo from plugins to a single module.

@kobenguyent
Copy link
Collaborator

I could not reproduce this with my conf, thou

const { setHeadlessWhen } = require('@codeceptjs/configure');

setHeadlessWhen(process.env.HEADLESS);

exports.config = {
  tests: './todomvc-tests/**/*_test.js',
  output: './output',
  helpers: {
    Playwright: {
      url: 'http://localhost',
      waitForTimeout: 5000,
      show: false,
    },

    REST: {},

    CustomHelper: {
      require: './todomvc-tests/helpers/custom.helper.js'
    }
  },

  gherkin: {
    features: './todomvc-tests/features/*.feature',
    steps: [
      './todomvc-tests/step-definitions/create-todos.steps.js'
    ]
  },

  include: {
    TodosPage: './todomvc-tests/pages/todos.page.js'
  },
  bootstrap: null,
  mocha: {},
  name: 'codecept demo tests'
}
➜  helloworld npm run codeceptjs:demo

> codeceptjs-tests@0.1.0 codeceptjs:demo
> codeceptjs run -c node_modules/@codeceptjs/examples

CodeceptJS v3.7.2 #StandWithUkraine
Using test root "/Users/t/Desktop/helloworld/node_modules/@codeceptjs/examples"

Create Todos with BDD --
  ✔ Create a single todo item @bdd in 3343ms
codepress demo --
^C%      

@mirao
Copy link
Contributor Author

mirao commented Mar 5, 2025

@kobenguyent Still I'm able to reproduce it.
Just create a new folder, cd there, run npx create-codeceptjs ., then npx codeceptjs init and create a project in TypeScript. You get the warning even during initialization of a project

mirao@rog:~/workspace/my$ npx codeceptjs init

  Welcome to CodeceptJS initialization tool
  It will prepare and configure a test environment for you

 Useful links:

  👉 How to start testing ASAP: https://codecept.io/quickstart/#init
  👉 How to select helper: https://codecept.io/basics/#architecture
  👉 TypeScript setup: https://codecept.io/typescript/#getting-started

Installing to /home/mirao/workspace/my
? Do you plan to write tests in TypeScript? Yes
? Where are your tests located? ./*_test.ts
? What helpers do you want to use? Playwright
? Where should logs, screenshots, and reports to be stored? ./output
? Do you want to enable localization for tests? http://bit.ly/3GNUBbh English (no localization)
Configure helpers...
? [Playwright] Browser in which testing will be performed. Possible options: chromium, firefox, webkit or electron 
chromium
? [Playwright] Base url of site to be tested http://localhost
? [Playwright] Show browser window Yes

Steps file created at ./steps_file.ts
Config created at /home/mirao/workspace/my/codecept.conf.ts
Directory for temporary output files created at './output'
Installing packages:  typescript, ts-node, @types/node

up to date, audited 950 packages in 758ms

125 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (4 low, 4 moderate, 6 high)

To address issues that do not require attention, run:
  npm audit fix

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
Deprecation Warning: 'tryTo' has been moved to the 'codeceptjs/effects' module. Disable tryTo plugin to remove this warning.
Deprecation Warning: 'retryTo' has been moved to the 'codeceptjs/effects' module. Disable retryTo plugin to remove this warning.
TypeScript Definitions provide autocompletion in Visual Studio Code and other IDEs
Definitions were generated in steps.d.ts

 Almost ready... Next step:
Creating a new test...
----------------------
? Feature which is being tested (ex: account, login, etc) My
? Filename of a test My_test.ts
Deprecation Warning: 'tryTo' has been moved to the 'codeceptjs/effects' module. Disable tryTo plugin to remove this warning.
Deprecation Warning: 'retryTo' has been moved to the 'codeceptjs/effects' module. Disable retryTo plugin to remove this warning.

Test for My_test.ts was created in /home/mirao/workspace/my/My_test.ts

--
CodeceptJS Installed! Enjoy supercharged testing! 🤩
Find more information at https://codecept.io

and also if you run a test

mirao@rog:~/workspace/my$ codeceptjs run
Deprecation Warning: 'tryTo' has been moved to the 'codeceptjs/effects' module. Disable tryTo plugin to remove this warning.
Deprecation Warning: 'retryTo' has been moved to the 'codeceptjs/effects' module. Disable retryTo plugin to remove this warning.
CodeceptJS v3.7.2 #StandWithUkraine
Using test root "/home/mirao/workspace/my"

My --
  ✔ test something in 3ms

  OK  | 1 passed   // 242ms

Tested with CodeceptJS 3.7.2, NodeJS 22.13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants