Sha256: f1f70ad8e54dd451477ba916fba0b5e7a4fa3ff33df686e18c496ff076d21efc

Contents?: true

Size: 1.02 KB

Versions: 3

Compression:

Stored size: 1.02 KB

Contents

<% if %w[selenium watir].include? automation %>
require_relative 'base_spec'
require_relative '../page_objects/pages/login_page'

class LoginSpec < BaseSpec
  describe 'Login' do
    before(:each) do
      LoginPage.visit
    end

    it 'can login with valid credentials' do
      LoginPage.login('aguspe', '12341234')
      expect(LoginPage.header.customer_name).to eq 'Welcome back Agustin'
    end

    it 'cannot login with wrong credentials' do
      LoginPage.login('aguspe', 'wrongPassword')
      expect(LoginPage.header.customer_name).to be_empty
    end
  end
end
<% else %>
require_relative '../page_objects/pages/confirmation_page'
require_relative '../page_objects/pages/home_page'
require_relative 'base_spec'
require_relative '../page_objects/pages/login_page'

class LoginSpec < BaseSpec
  describe 'Login' do
    it 'Login with valid credentials' do
      HomePage.go_to_login
      LoginPage.login('alice', 'mypassword')
      expect(ConfirmationPage.login_message).to eq 'You are logged in as alice'
    end
  end
end
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_raider-0.2.2 lib/generators/templates/rspec/spec.tt
ruby_raider-0.2.1 lib/generators/templates/rspec/spec.tt
ruby_raider-0.2.0 lib/generators/templates/rspec/spec.tt