cypress-tags
cypress-tags copied to clipboard
Suite argument "title" must be a string. Received type "object"
I'm following the same format as ReadMe yet I keep getting an error, why?
Example:
/// <reference types='cypress-tags' />
describe(['@smoke'], 'User Privileges - Standard User', () => {
Error:
The following error originated from your test code, not from Cypress.
> Suite argument "title" must be a string. Received type "object"
When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.
Cypress could not associate this error to any specific test.
We dynamically generated a new test to display this failure.
Hi @GeorgeXCV
It sounds like the preprocessor isn't set up correctly.
Can you show what you've got in your cypress.config.ts
file please?
Hi @GeorgeXCV
It sounds like the preprocessor isn't set up correctly.
Can you show what you've got in your
cypress.config.ts
file please?
I lost my changes and now I can't get the package to work at all:
Cannot find module 'cypress-tags' or its corresponding type declarations.ts(2307)
This was config file:
import { defineConfig } from "cypress";
import { checkGmail, CheckGmailParam } from "../core-cypress/cypress/plugins/checkGmail";
import * as path from "path";
import * as fs from "fs"
import admin from 'firebase-admin';
import { plugin as cypressFirebasePlugin } from 'cypress-firebase';
import * as serviceAccountDev from './cypress/support/serviceAccountKeyDev.json'
import { tagify } from 'cypress-tags';
export default defineConfig({
e2e: {
async setupNodeEvents(on, config) {
const version = config.env.version || 'development'
const configFile = await import(path.join(
config.projectRoot,
'cypress/config',
`${version}.json`
));
if (version == 'development') {
cypressFirebasePlugin(on, config, admin, {
credential: admin.credential.cert(serviceAccountDev as admin.ServiceAccount)
});
config.projectId = ""
config.baseUrl = configFile.baseUrl
config.env = configFile.env
config.defaultCommandTimeout = 10000
config.chromeWebSecurity = false
config.videoCompression = 15 // Speed up video compression
on("task", {
async checkGmail(args: CheckGmailParam) {
return await checkGmail(args);
},
});
on('after:spec', (_spec, results) => {
if (results && results.stats.failures === 0 && results.video) {
fs.unlink(results.video, (err) => {
if (err) console.log(`Failed to delete video with error: ${err}`)
return
})
}
})
on('file:preprocessor', tagify(config));
return config
},
reporter: 'mochawesome'
},
});
`
Hi @GeorgeXCV
Can you try reinstalling the plugin?
Hi @GeorgeXCV
Can you try reinstalling the plugin?
Tried that already along with npm install
.
Can you give me the version of cypress-tags and Cypress that you're using?
And can you confirm Cypress is working as expected when you remove the cypress-tags plugin?
Can you give me the version of cypress-tags and Cypress that you're using?
"cypress": "^10.1.0",
"cypress-tags": "^1.1.1",
And can you confirm Cypress is working as expected when you remove the cypress-tags plugin?
Yes
And you can see cypress-tags
is installed when you run npm ls cypress-tags
?
I'm not sure why node wouldn't be able to find the package if it's all installed.
Hi @GeorgeXCV
This appeared to be an issue with 1.1.1, a new version 1.1.2 has now be released that should fix the issue.
@annaet Thanks, seems to work now! Although I have one last issue, I get this error when running tests:
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'
.
It is caused by this line: on('file:preprocessor', tagify(config));
.
Is it some project configuration required that is not included in ReadMe?
Although I have one last issue, I get this error when running tests:
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'
.It is caused by this line:
on('file:preprocessor', tagify(config));
.Is it some project configuration required that is not included in ReadMe?
Having the same issue
I follow the readme but I got the error "Suite argument "title" must be a string. Received type "object". Could anyone help me? "cypress": "^12.8.1", "cypress-tags": "^1.1.2",
Seeing same error as above when I attempt to execute any test: "Suite argument "title" must be a string. Received type "object". "cypress": "^11.2.0" "cypress-tags": "^1.1.2"
describe(["DESC_TEST"],"Desc_Title", () => { it(["it_tag"],"It_title", ()=> { cy.log("hello world") }); });