问题
Is there a way in FitNesse to access page tags from inside the page?
I need to change database connection strings at test start-up and would like to use a tag as a switch.
回答1:
I would recommend that you create multiple top level suites, one for each environment (e.g. one for testing locally and one for Azure) that defines the environment specific settings using wiki symbols (i.e. !define ...
). The tests that are to be executed in all environments can be defined is separate suite that is included in each environment's suite using a symbolic link. The tests in the shared suites use the wiki symbols to get the values for the environment they are included in.
- This makes it explicit which settings are different between each environment
- All different environments are visible in the wiki
- Adding or removing an environment setting requires no (fixture) code changes
- You can add environment specific tests for each environment (just add them to the environment's suite besides the shared tests included via symbolic link)
来源:https://stackoverflow.com/questions/64765404/can-fitnesse-page-tags-be-used-in-page