Create a Term of a given taxonomy
Term name
Taxonomy
{ slug - Taxonomy slug parent - Parent taxonomy (ID or name) description - Taxonomy description beforeSave - Callable function hook }
Create new category with default name "Test category"
cy.createTerm() Copy
cy.createTerm()
Create new category with given name
cy.createTerm('Category') Copy
cy.createTerm('Category')
Create a category and use it's ID
cy.createTerm('Category').then(term => { cy.log(term.term_id);}); Copy
cy.createTerm('Category').then(term => { cy.log(term.term_id);});
Create new term in a product taxonomy
cy.createTerm('Product name', 'product') Copy
cy.createTerm('Product name', 'product')
Create child category for existing Parent with custom description and slug
cy.createTerm('Child', 'category', { parent: 'Parent', slug: 'child-slug', description: 'Custom description'}) Copy
cy.createTerm('Child', 'category', { parent: 'Parent', slug: 'child-slug', description: 'Custom description'})
Create a Term of a given taxonomy