-
-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow gherkin keywords as supported by cucumber (#4784)
- Loading branch information
Showing
19 changed files
with
206 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
test/data/sandbox/configs/translation/translation_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
Caratteristica('DevTo'); | ||
Funzionalità('DevTo') | ||
|
||
Prima(() => { | ||
console.log('Before'); | ||
}); | ||
console.log('Before') | ||
}) | ||
|
||
lo_scenario('Simple translation test', () => { | ||
console.log('Simple test'); | ||
}); | ||
Esempio('Simple translation test', () => { | ||
console.log('Simple test') | ||
}) | ||
|
||
Scenario('Simple translation test 2', () => { | ||
console.log('Simple test 2'); | ||
}); | ||
console.log('Simple test 2') | ||
}) | ||
|
||
Dopo(() => { | ||
console.log('After'); | ||
}); | ||
console.log('After') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
exports.config = { | ||
tests: './*_no_test.js', | ||
timeout: 10000, | ||
output: '../output', | ||
helpers: { | ||
BDD: { | ||
require: '../support/bdd_helper.js', | ||
}, | ||
}, | ||
gherkin: { | ||
features: './features/examples.nl.feature', | ||
steps: ['./features/step_definitions/my_steps.nl.js'], | ||
}, | ||
include: {}, | ||
bootstrap: false, | ||
mocha: {}, | ||
name: 'sandbox', | ||
translation: 'nl-NL', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#language: nl | ||
Functionaliteit: Checkout proces | ||
Om producten te kopen | ||
Als klant | ||
Moet ik in staat zijn om meerdere producten te kopen | ||
|
||
@i18n | ||
Abstract Scenario: korting bestellen | ||
Gegeven ik heb een product met een prijs van <price>$ in mijn winkelwagen | ||
En de korting voor bestellingen van meer dan $20 is 10 % | ||
Wanneer ik naar de kassa ga | ||
Dan zou ik de totaalprijs van "<total>" $ moeten zien | ||
|
||
Voorbeelden: | ||
| price | total | | ||
| 10 | 10.0 | |
17 changes: 17 additions & 0 deletions
17
test/data/sandbox/i18n/features/step_definitions/my_steps.nl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const I = actor() | ||
|
||
Given('ik heb een product met een prijs van {int}$ in mijn winkelwagen', price => { | ||
I.addItem(parseInt(price, 10)) | ||
}) | ||
|
||
Given('de korting voor bestellingen van meer dan ${int} is {int} %', (maxPrice, discount) => { | ||
I.haveDiscountForPrice(maxPrice, discount) | ||
}) | ||
|
||
When('ik naar de kassa ga', () => { | ||
I.checkout() | ||
}) | ||
|
||
Then('zou ik de totaalprijs van "{float}" $ moeten zien', price => { | ||
I.seeSum(price) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
const { gherkinTranslations } = require('./utils') | ||
const langCode = 'nl' | ||
|
||
module.exports = { | ||
I: 'Ik', | ||
contexts: { | ||
...gherkinTranslations(langCode), | ||
}, | ||
actions: { | ||
amOutsideAngularApp: 'ben_buiten_angular_app', | ||
amInsideAngularApp: 'ben_binnen_angular_app', | ||
waitForElement: 'wacht_op_element', | ||
waitForClickable: 'wacht_tot_klikbaar', | ||
waitForVisible: 'wacht_tot_zichtbaar', | ||
waitForEnabled: 'wacht_tot_ingeschakeld', | ||
waitForInvisible: 'wacht_tot_onzichtbaar', | ||
waitInUrl: 'wacht_in_url', | ||
waitForText: 'wacht_op_tekst', | ||
moveTo: 'beweeg_de_cursor_naar', | ||
refresh: 'vernieuw_pagina', | ||
refreshPage: 'vernieuw_pagina', | ||
haveModule: 'heb_module', | ||
resetModule: 'reset_module', | ||
amOnPage: 'ben_op_pagina', | ||
click: 'klik', | ||
doubleClick: 'dubbelklik', | ||
see: 'zie', | ||
dontSee: 'zie_niet', | ||
selectOption: 'selecteer_optie', | ||
fillField: 'vul_veld_in', | ||
pressKey: 'druk_op_toets', | ||
triggerMouseEvent: 'trigger_een_muis_event', | ||
attachFile: 'voeg_bestand_toe', | ||
seeInField: 'zie_in_veld', | ||
dontSeeInField: 'zie_niet_in_veld', | ||
appendField: 'voeg_toe_aan_veld', | ||
checkOption: 'vink_optie_aan', | ||
seeCheckboxIsChecked: 'zie_dat_checkbox_aangevinkt_is', | ||
dontSeeCheckboxIsChecked: 'zie_niet_dat_checkbox_aangevinkt_is', | ||
grabTextFrom: 'pak_tekst_van', | ||
grabValueFrom: 'pak_waarde_van', | ||
grabAttributeFrom: 'pak_attribuut_van', | ||
seeInTitle: 'zie_in_titel', | ||
dontSeeInTitle: 'zie_niet_in_titel', | ||
grabTitle: 'pak_titel', | ||
seeElement: 'zie_element', | ||
dontSeeElement: 'zie_element_niet', | ||
seeInSource: 'zie_in_broncode', | ||
dontSeeInSource: 'zie_niet_in_broncode', | ||
executeScript: 'voer_script_uit', | ||
executeAsyncScript: 'voer_asynchroon_script_uit', | ||
seeInCurrentUrl: 'zie_in_huidige_url', | ||
dontSeeInCurrentUrl: 'zie_niet_in_huidige_url', | ||
seeCurrentUrlEquals: 'zie_dat_url_gelijk_is', | ||
dontSeeCurrentUrlEquals: 'zie_dat_url_niet_gelijk_is', | ||
saveScreenshot: 'sla_screenshot_op', | ||
setCookie: 'stel_cookie_in', | ||
clearCookie: 'verwijder_cookie', | ||
seeCookie: 'zie_cookie', | ||
dontSeeCookie: 'zie_cookie_niet', | ||
grabCookie: 'pak_cookie', | ||
resizeWindow: 'verander_venstergrootte', | ||
wait: 'wacht', | ||
haveHeader: 'gebruik_http_header', | ||
clearField: 'wis_veld', | ||
dontSeeElementInDOM: 'zie_element_niet_in_DOM', | ||
moveCursorTo: 'beweeg_de_cursor_naar', | ||
scrollTo: 'scroll_naar', | ||
sendGetRequest: 'doe_een_get_verzoek', | ||
sendPutRequest: 'doe_een_put_verzoek', | ||
sendDeleteRequest: 'doe_een_delete_verzoek', | ||
sendDeleteRequestWithPayload: 'doe_een_delete_verzoek_met_payload', | ||
sendPostRequest: 'doe_een_post_verzoek', | ||
switchTo: 'wissel_naar_iframe', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports.gherkinTranslations = function (langCode) { | ||
const gherkinLanguages = require('@cucumber/gherkin/src/gherkin-languages.json') | ||
const { feature, scenario, scenarioOutline } = gherkinLanguages[langCode] | ||
return { | ||
Feature: feature[0], | ||
Scenario: scenario[0], | ||
ScenarioOutline: scenarioOutline[0], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters