From e5d2a81b86d59c50ff5c488da017a9b56d0442f0 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 5 Jan 2016 12:46:42 +0000 Subject: [PATCH] Add basic spinach tests for project builds --- features/project/builds.feature | 11 +++++++++++ features/steps/project/builds.rb | 14 ++++++++++++++ features/steps/shared/builds.rb | 16 ++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 features/project/builds.feature create mode 100644 features/steps/project/builds.rb create mode 100644 features/steps/shared/builds.rb diff --git a/features/project/builds.feature b/features/project/builds.feature new file mode 100644 index 00000000000..3f005b5133c --- /dev/null +++ b/features/project/builds.feature @@ -0,0 +1,11 @@ +Feature: Project Builds + Background: + Given I sign in as a user + And I own a project + And CI is enabled + And I have recent build for my project + + Scenario: I browse build summary page + When I visit recent build summary page + Then I see summary for build + And I see build trace diff --git a/features/steps/project/builds.rb b/features/steps/project/builds.rb new file mode 100644 index 00000000000..769690dd79d --- /dev/null +++ b/features/steps/project/builds.rb @@ -0,0 +1,14 @@ +class Spinach::Features::ProjectBuilds < Spinach::FeatureSteps + include SharedAuthentication + include SharedProject + include SharedBuilds + include RepoHelpers + + step 'I see summary for build' do + expect(page).to have_content "Build ##{@build.id}" + end + + step 'I see build trace' do + expect(page).to have_css '#build-trace' + end +end diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb new file mode 100644 index 00000000000..6f9cd174729 --- /dev/null +++ b/features/steps/shared/builds.rb @@ -0,0 +1,16 @@ +module SharedBuilds + include Spinach::DSL + + step 'CI is enabled' do + @project.enable_ci + end + + step 'I have recent build for my project' do + ci_commit = create :ci_commit, project: @project, sha: sample_commit.id + @build = create :ci_build, commit: ci_commit + end + + step 'I visit recent build summary page' do + visit namespace_project_build_path(@project.namespace, @project, @build) + end +end