Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add games cucumber tests #28

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions features/games.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Feature: Main landing page

Scenario: Visiting the landing page as a guest
Given I am on the login page
Then I should see "Welcome to CSE 606 Team Arcade's Project"
When I press "Continue as Guest"
Then I should see "Welcome, Guest!"
And I should see a list of games
And I should see "Spelling Bee"
And I should see "Wordle"
And I should see "Play"
When I follow "Play"
Then I should see "Spelling Bee"

Scenario: Visiting the landing page as a logged in user
Given I am on the login page
Then I should see "Welcome to CSE 606 Team Arcade's Project"
And I should see "Login with Google"
When I login as System Admin
Then I should see "Howdy Spongebob!"
And I should see a list of games
And I should see "Spelling Bee"
And I should see "Wordle"
When I follow "Play"
Then I should see "Spelling Bee"
7 changes: 7 additions & 0 deletions features/step_definitions/games_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Given('I am on the landing page') do
visit games_path
end

Then('I should see a list of games') do
expect(page).to have_css('.game-list')
end
5 changes: 5 additions & 0 deletions features/support/seeds.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# features/support/seeds.rb

Before do
Rails.application.load_seed # Loads the seeds.rb file
end
Loading