This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests
- Loading branch information
Showing
5 changed files
with
64 additions
and
2 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
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
34 changes: 34 additions & 0 deletions
34
src/test/java/ru/sbtqa/tag/qautils/cucumber/CucumberUtilsTest.java
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,34 @@ | ||
package ru.sbtqa.tag.qautils.cucumber; | ||
|
||
import cucumber.api.Scenario; | ||
import cucumber.runtime.ScenarioImpl; | ||
import java.util.Locale; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
|
||
public class CucumberUtilsTest { | ||
|
||
@Test | ||
public void returnCorrectLanguageLocaleTest() { | ||
Scenario scenario = mock(ScenarioImpl.class); | ||
when(scenario.getUri()).thenReturn("src/test/resources/features/Correct.feature"); | ||
Locale expectedLocale = new Locale("ru"); | ||
|
||
Locale actualLocale = CucumberUtils.getLocale(scenario); | ||
|
||
Assert.assertEquals(expectedLocale, actualLocale); | ||
} | ||
|
||
@Test | ||
public void fallbackToDefaultLanguageTest() { | ||
Scenario scenario = mock(ScenarioImpl.class); | ||
when(scenario.getUri()).thenReturn("src/test/resources/features/Empty.feature"); | ||
Locale expectedLocale = new Locale("en"); | ||
|
||
Locale actualLocale = CucumberUtils.getLocale(scenario); | ||
|
||
Assert.assertEquals(expectedLocale, actualLocale); | ||
} | ||
} |
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,5 @@ | ||
#language:ru | ||
Функционал: Тестовая фича | ||
|
||
Сценарий: Тестовый сценарий | ||
* открывается страница "Тестовая страница" |
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,4 @@ | ||
Функционал: Тестовая фича | ||
|
||
Сценарий: Тестовый сценарий | ||
* открывается страница "Тестовая страница" |