Skip to content

Can I Override a Built-In Function? #4309

Closed Answered by kobenguyent
tien-tran-ts asked this question in Q&A
Discussion options

You must be logged in to vote


perhaps you could try define the function with same name in custom steps file https://codecept.io/pageobjects/#actor then it would override the built-in function.

Before(async () => {
	newUser = await I.have('user', null, null);
	id = newUser.id;
});

Scenario.only('Verify creating new user', () => {
	I.sendGetRequest('hello', '123');
...

    I have "user", , 
    › Creating user {"name":"Eulalia Schoen","job":"leader"}
    › [Request] {"method":"POST","url":"/api/users","data":{"name":"Eulalia Schoen","job":"leader"},"baseURL":"https://reqres.in","headers":{"Content-Type":"application/json","Accept":"application/json"}}
    › [Response] {"name":"Eulalia Schoen","job":"leader","id":"350…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tien-tran-ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants