Content translation/Developers/GWT-Definitions

From mediawiki.org

Given-When-Then Definitions of UI features[edit]

Paragraph Alignment[edit]

Scenario: Paragraph alignment does not break when inserting simple text, links and templates

Given I am logged into the CX wiki
	And I am in the translation interface with the article "She Who Dwells" in the source column and the article "She Who Dwells in the Secret Place of the Most High Shall Abide Under the Shadow of the Almighty" in the translation column
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with the article "She Who Dwells in the Secret Place of the Most High Shall Abide Under the Shadow of the Almighty" in the source column and the article "She Who Dwells" in the translation column
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with the article "She Who Dwells" in the source column and the article "She Who Dwells" in the translation column
When I change the heading of the translation column to "She Who Dwells in the Secret Place of the Most High Shall Abide Under the Shadow of the Almighty"
Then the sections in the Source and Translation columns should not be misaligned

Scenario: Paragraph alignment does not break when inserting simple text, links and templates

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add translation using the +Add Translation option
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add an image from the Source column into the Target column using +Add Translation (there is no other way of doing it right now)
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add a section with an Infobox template using +Add Translation
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And then clear the entire text using backspace/delete
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And then clear some parts of the text using backspace/delete
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And then clear the entire text using Select All and backspace/delete
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And then clear the entire text using Clear Translation
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And then clear the entire text using Clear Translation
	And restore the original translation using Restore
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And then clear the entire text using Clear Translation
	And then copy the text in the source column using the Use Source Text option
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add copy a section heading using +Add Translation
	And then clear the section heading
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And then add some more lines in the Translation column that increases the number of visible lines in the column
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And then clear some lines in the Translation column that decreases the number of visible lines in the column
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And then clear some lines in the Translation column
	And then add some additional lines in the Translation column
Then the sections in the Source and Translation columns should not be misaligned

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I add some text in the Translation column using +Add Translation
	And I select some text in the Translation column and insert a link
Then the sections in the Source and Translation columns should not be misaligned

Cards[edit]

Instruction Card[edit]

Scenario: Visibility of the Instruction Card

Given I am logged into the CX wiki
When I enter the translation interface
Then the Instructions card should be visible in the third column

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When type text in the translation column
Then the Instructions card should be visible in the third column until I stop typing (currently it keeps showing up and vanishing randomly when people are typing)

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I click add some text in the translation column
	And the Machine Translation card is displayed
Then the Instructions card should not be visible in the third column

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I click add some text in the translation column
	And I click inside the translation column
	And the Machine Translation card is displayed
Then the Instructions card should not be visible in the third column

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I click on a link in the source column or translation column
	And one or more link cards are displayed
Then the Instructions card should not be visible in the third column

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I select some text in source column
	And a Definition card is displayed
Then the Instructions card should not be visible in the third column

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I select some text in translation column
	And one or more link cards are displayed
Then the Instructions card should not be visible in the third column

Advanced Feature (not in design, but recommended by PM during discussions)

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
	And the Instructions card is visible
When I perform an action to display a Link, MT or Definition card
Then the Instructions card should be minimized somewhere in the third column

Given I am an advanced user and logged into the CX wiki
	And I am in the translation interface with an article already open
	And the Instructions card is visible
When I click on an option (not defined) on the Instructions card
Then the Instructions card should be removed until I enable its display again

Link Cards[edit]

Scenario: Visibility of the Link Cards

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
When I click on a link in the source column
Then any existing cards on the side bar is hidden
	And one or more link cards should be displayed

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
	And I have translated some text with links in both source and target language
When I click on a link in the source column
Then the corresponding link in the target column is highlighted
	And two link cards should be displayed for the source and target language

Given I am logged into the CX wiki
	And I am in the translation interface with an article already open
	And I have translated some text with links in only the source language
When I click on a link in the source column
Then the corresponding link in the target column is highlighted
	And one link cards should be displayed for the source language


MT Cards[edit]

Scenario: When the current language is supported, it should not be explicitly stated in the Services list ( i.e., the selector should indicate "From Apertium" instead of "From Apertium, Español to Català" )

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
When I click on '+Add Translation to use MT
Then the MT card should display the message 'From <MT service name>

Scenario: When the user selects "Don't use machine translation", the default behaviour is to have the empty paragraph (not use the source text).

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
When I click on '+Add Translation/+Add'
     And I have selected 'Do not use Machine Translation' from the MT card in the tools area
Then the translation column for the paragraph should present an empty input area

Scenario: The selection includes a "Use source text" option (which will be the default when there is no available automatic translation service).

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
     And the source and target languages do not have MT 
When I click on paragraph
     And then I click on an MT card
Then I should see the option to 'User Source Text' in the card

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
     And the source and target languages do not have MT 
     And I have selected 'Use Source Text' from the MT cards
When I click on '+Add Translation'
Then text from the source column is copied over into the translation column

Publishing[edit]

Scenario: The Publish button creates a page in wikitext and displays the url

Given I am logged into the CX wiki
When I enter the translation interface
	And do not make any edits
Then the Publish button should be not be in active state

Given I am logged into the CX wiki
When I enter the translation interface
	And make an edit
Then the Publish button should be activated

Given I am in the translation interface
	And I have made some edits
	And the Publish button is active
When I press the Publish button
Then the page should be published
And the link to the page under the user’s namespace displayed

Given I am in the translation interface (not implemented; currently the user is taken to the page in the same tab and out of the translation interface)
	And I Published a page with the Publish button
When I click on the link to the published page
Then the page is displayed in a new tab

Cursor Positioning[edit]

Scenario: When clicking on a paragraph, in addition to whichever automatic action is performed the cursor is positioned in the new paragraph.

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
When I click '+Add Translation'
Then the machine translated text should be inserted in the translation column
     And the cursor is placed at the beginning of the paragraph

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
When I click '+Add Translation'
     And click copy the source text
Then the source text should be inserted in the translation column
     And the cursor is placed at the beginning of the paragraph

Scenario: When clicking on a card info or actions, after performing the action, the text cursor should be restored to the same position it originally was.

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
When I click '+Add Translation' to translate the paragraph
     And add a link in the translated paragraph
Then the link should be inserted
     And the cursor should be at the ending position where the link was inserted

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
When I click '+Add Translation' to translate the paragraph
     And select a link in the translated paragraph and remove it
Then the link should be removed
     And the cursor should be at the ending position of the selected text


Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
When I click '+Add Translation' to translate the paragraph
     And select to clear translation from the MT card
Then the text in the translation column should be cleared
     And the cursor should be placed in the input area

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
     And have added MT generated translation with +Add Translation
     And have cleared the translation from the MT card
When I click 'Restore'
Then the earlier translated text should be restored
     And the cursor should be placed in the beginning

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
     And have clicked +Add Translation
     And have added added the source text in the translation column
     And have cleared the translation from the MT card
When I click 'Restore'
Then the earlier translated text should be restored
     And the cursor should be placed in the beginning

Scenario: When clicking on the source text, the input should kept active and moved to a different paragraph only if the user is adding that paragraph to the translation

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
     And have clicked +Add Translation to insert text in the translation column of a paragraph
     And I have clicked in the translated column to have an active cursor
When I click on the source column of a different paragraph
Then the input area focus should remain in the column where I was making the original edit

Scenario: The input focus on the translation should be removed when input is needed for another tool

Given I am logged into the CX wiki
     And I am in the translation interface with an article already open
     And have clicked +Add Translation to insert text in the translation column of a paragraph
     And I have clicked in the translated column to have an active cursor
When I click on the search area
Then the input area should not have focus any more