考慮下面的情形,Specflow:讀示例表數據BeforeScenario或AfterScenario鉤
@regression @msexcel
Scenario Outline: Open all supported excel formats from windows explorer
Given I navigate to a windows explorer directory named <directoryName>
Examples:
| directoryName | excelDocumentName | expectedTitle |
| OfficeDocuments\Excel | Excel2016_3Worksheets_XLSM.xlsm | Excel2016_3Worksheets_XLSM.pdf [Read-Only] - pdfDocs |
| OfficeDocuments\Excel | Excel2016_3Worksheets_XLT.xlt | Excel2016_3Worksheets_XLT.pdf [Read-Only] - pdfDocs |
我想讀示例表之前或場景掛鉤之後。那可能嗎?如果是這樣,請幫助建議。 謝謝。
爲什麼你要做到這一點依賴注入的ScenarioContext?你試圖解決的實際問題是什麼?我不認爲你可以做你想做的事情(因爲在生成測試時,大綱會變成幾個獨立的場景),但如果我們能夠理解根本問題,我們可能會得到更多的解決方案。 –