Skip to content

Conversation

@cmayo
Copy link
Collaborator

@cmayo cmayo commented Sep 15, 2023

📚 Description

You can create functions with the following names in your test script to perform actions before and after test/script:

setUp

If this function exists in the test script it will be executed before each test execution.

setUpBeforeScript

If this function exists in the test script it will be executed only one time before all tests execution.

tearDown

If this function exists in the test script it will be executed after each test execution.

tearDownAfterScript

If this function exists in the test script it will be executed only one time after all tests execution.

✅ To-do list

  • Make sure that all the pipeline passes
  • Make sure to update the CHANGELOG.md to reflect the new feature or fix

Copy link
Member

@Chemaclass Chemaclass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🤩 This will close #47

@Chemaclass Chemaclass added the enhancement New feature or request label Sep 15, 2023
@Chemaclass
Copy link
Member

Can you please add these new functions to the CHANGELOG.md, @cmayo?

Copy link
Collaborator

@fabriziofs fabriziofs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work ✨

function test_no_function_is_executed_with_execute_function_if_exists() {
local function_name='notExistingFunction'

assertEmpty "$(executeFunctionIfExists "$function_name")"
Copy link
Member

@khru khru Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function does not exist assertEmpty may be you mean assertNotEquals

Copy link
Collaborator Author

@cmayo cmayo Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. I'm trying to check why I didn't get any error with this non-existent method

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, thanks to you, We've just added the assert #93 (it needs a refactor, but the first step is there)

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants