Main Avalanche Network server application. Built with Ruby on Rails.

missions_view.feature 9.5KB

    @mission_view @mission Feature: Missions In order to browse for missions As an Avalanche Agent I want to view missions and agent roles Background: Given the website is configured And the following list of missions | title | objective | briefing | status | | Test 001 | 1 2 3 testing | Testing the website | 2 | | Bank Robbery | Rob a bank and get rich | The target will be Fort Knox. Only expert agents allowed. | 2 | And the the mission "Bank Robbery" has the following rewards | title | description | img | | 1M Dollars | You get 1.000.000,00 dollars | money.png | | 200K Dollars | You get 200.000,00 dollars | money.png | And the the mission "Bank Robbery" has the following agents | role | objective | briefing | description | | Mr. Pink | Get the inside the vault | Find the manager, make him open the vault and get all the money | | | Mr. Blue | Take care of the hostages | Make sure the hostages dont try anything stupid. | | | Mr. Green | Drive the gettaway car | Wait for the others to return and lose the cops. | | And the agent "Mr. Pink" in the mission "Bank Robbery" has the following steps | position | title | description | completed | | 1 | Get to the bank | Make everbody surrender | false | | 2 | Find the bank manager | Find the bank manager with the vault keys | false | | 3 | Open the vault | Use the keys to open the vault | false | | 4 | Get the money | Put all the money in the bag | false | | 5 | Leave the bank | Exit the bank and get to the getaway car | false | And the step "Get to the bank" from agent "Mr. Pink" in the mission "Bank Robbery" has the following validations | validation_type | description | | ValidationText | What time did you arrive? | | ValidationText | How many hostages where there? | And the step "Find the bank manager" from agent "Mr. Pink" in the mission "Bank Robbery" has the following validations | validation_type | description | | ValidationText | What is the bank manager's name? | And the agent "Mr. Blue" in the mission "Bank Robbery" has the following steps | position | title | description | completed | | 1 | Get to the bank | Make everbody surrender | false | | 2 | Secure the hostages | Secure the hostages while Mr. pink gets the vault | false | | 3 | Leave the bank | Exit the bank and get to the getaway car | false | And the agent "Mr. Green" in the mission "Bank Robbery" has the following steps | position | title | description | completed | | 1 | Get a good car for the job | Find a good car for the mission | false | | 2 | Take everbody to the bank | Take Mr. Pink and Mr. Blue to the bank | false | | 3 | Getaway | Wait for Mr. Pink and Mr. Blue to return and lose the cops | false | And the agent "Mr. Pink" in the mission "Bank Robbery" has the reward "1M Dollars" And the agent "Mr. Blue" in the mission "Bank Robbery" has the reward "1M Dollars" And the agent "Mr. Green" in the mission "Bank Robbery" has the reward "200K Dollars" Scenario: View mission list When I go to the missions page Then I should see "Bank Robbery" And within "#mission-bank-robbery" I should see "Rob a bank and get rich" And within "#mission-bank-robbery" I should see "Launched" And within "#mission-bank-robbery" I should see "0%" And I should see "Test 001" And within "#mission-test-001" I should see "1 2 3 testing" And within "#mission-test-001" I should see "Launched" And within "#mission-test-001" I should see "0%" Scenario: View mission When I go to the missions page And I click in the link "Bank Robbery" Then within "h1" I should see "Bank Robbery" And I should see "Launched" And I should see "0%" And I should see "The target will be Fort Knox. Only expert agents allowed." And I should see "1M Dollars" And I should see "You get 1.000.000,00 dollars" And I should see "200K Dollars" And I should see "You get 200.000,00 dollars" And I should see the image "money.png" When within "#mission-tabs-nav" I click in the link "Agents" Then I should see "Mr. Pink" And within "#agent-mr-pink" I should see "Get the inside the vault" And within "#agent-mr-pink" I should see "Get to the bank" And within "#agent-mr-pink" I should see "1M Dollars" And within "#agent-mr-pink" I should see "Find the bank manager" And within "#agent-mr-pink" I should not see "Leave the bank" And I should see "Mr. Blue" And within "#agent-mr-blue" I should see "1M Dollars" And I should see "Mr. Green" And within "#agent-mr-green" I should see "200K Dollars" Scenario: View mission agent details When I go to the missions page And I click in the link "Bank Robbery" And within "#mission-tabs-nav" I click in the link "Agents" And within "#agent-mr-pink" I click in the link "Mr. Pink" Then I should see "Get the inside the vault" And I should see "Find the manager, make him open the vault and get all the money" And I should see "Get to the bank" And within "#step-1" I should see "Make everbody surrender" And within "#step-1" I should see "What time did you arrive?" And within "#step-1" I should see "How many hostages where there?" And I should see "Find the bank manager" And within "#step-2" I should see "What is the bank manager's name?" And I should see "Open the vault" And I should see "Get the money" And I should see "Leave the bank" Scenario: Take agent role from agents list page Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" has signed up and is logged in And I go to the missions page And I click in the link "Bank Robbery" And within "#mission-tabs-nav" I click in the link "Agents" And within "#agent-mr-pink" I should see "No Agent Selected" When within "#agent-mr-pink" I click in the link "Apply For Position" Then within "h2" I should see "Mr. Pink" Then I should see "You have taken the agent role" And within ".assigned-agent-role" I should see "Monty Cantsin" Scenario: Take agent role from agent page Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" has signed up and is logged in And I go to the missions page And I click in the link "Bank Robbery" And within "#mission-tabs-nav" I click in the link "Agents" And within "#agent-mr-pink" I should see "No Agent Selected" And within "#agent-mr-pink" I click in the link "Mr. Pink" Then within "h2" I should see "Mr. Pink" And within ".open-agent-role" I should see "This agent role is open for the first user that apply for it." When within ".open-agent-role" I click in the link "Take Agent Role" Then I should see "You have taken the agent role" And within ".assigned-agent-role" I should see "Monty Cantsin" Scenario: User not logged in try to take agent role Given I am not logged in And I go to the missions page And I click in the link "Bank Robbery" And within "#mission-tabs-nav" I click in the link "Agents" When within "#agent-mr-pink" I click in the link "Apply For Position" Then I should see "Please login first before completing this action." Scenario: Agent submits a step with a text validation Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" has signed up and is logged in And the user "monty_cantsin@canada.com" has taken the role "Mr. Pink" in the mission "Bank Robbery" When I visit the agent page "Mr. Pink" from the mission "Bank Robbery" And within "#step-1" I click in the link "Get to the bank" And within "#step-1" I click in the link "What time did you arrive?" And within the ".fields" number "1" I fill in "Content" with "I arrived at 15:00." And within "#step-1" I click in the button "submit" And I should see "Your step information has been submited for aproval by the mission director" And within "#step-1" I should see "Waiting for validation" And there should be 1 step waiting for validation on the "Bank Robbery" mission control page Scenario: Agent submits a step with an empty text validation Given the user "Monty" "Cantsin" with email "monty_cantsin@canada.com" has signed up and is logged in And the user "monty_cantsin@canada.com" has taken the role "Mr. Pink" in the mission "Bank Robbery" When I visit the agent page "Mr. Pink" from the mission "Bank Robbery" And within "#step-1" I click in the link "Get to the bank" And within "#step-1" I click in the link "What time did you arrive?" And within "#step-1" I click in the button "submit" And I should see "There was an error with the submission. Please try again." And there should be 0 step waiting for validation on the "Bank Robbery" mission control page