From ad4f8492d496a9e81787e5377d09fb59648b2b34 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Mon, 9 Oct 2023 18:30:50 -0700 Subject: [PATCH 1/5] add jenkins cucumber functionality --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bb1e248..87ca6bf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ pipeline { } stage('Run tests') { steps { - sh 'cucumber' + sh 'cucumber features --format json --out reports' } } stage('Report results') { @@ -39,6 +39,7 @@ pipeline { reportFiles: 'index.html', reportName: 'Test Results', reportTitles: 'Test Coverage']) + livingDocs() } } } From 33bfb23405994d0ec0427d80bac735a0bb5cec17 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Mon, 9 Oct 2023 18:35:50 -0700 Subject: [PATCH 2/5] add a setting for it --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 87ca6bf..fc8facc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ pipeline { } stage('Run tests') { steps { - sh 'cucumber features --format json --out reports' + sh 'cucumber features --format json --out cucumber.json' } } stage('Report results') { @@ -39,7 +39,7 @@ pipeline { reportFiles: 'index.html', reportName: 'Test Results', reportTitles: 'Test Coverage']) - livingDocs() + livingDocs(fileIncludePattern: "cucumber.json") } } } From b6010cd4313cb89596a0b245b39cd529711d5a83 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Mon, 9 Oct 2023 18:37:46 -0700 Subject: [PATCH 3/5] remove the config in there --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fc8facc..d34cdae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ pipeline { reportFiles: 'index.html', reportName: 'Test Results', reportTitles: 'Test Coverage']) - livingDocs(fileIncludePattern: "cucumber.json") + livingDocs() } } } From a90ff753b1f0338fbe593b45a72030bc3ccd2789 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Mon, 9 Oct 2023 18:52:48 -0700 Subject: [PATCH 4/5] use cucumber plugin --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d34cdae..8875b79 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ pipeline { reportFiles: 'index.html', reportName: 'Test Results', reportTitles: 'Test Coverage']) - livingDocs() + cucumber buildStatus: 'UNCHANGED', customCssFiles: '', customJsFiles: '', failedFeaturesNumber: -1, failedScenariosNumber: -1, failedStepsNumber: -1, fileIncludePattern: '**/cucumber.json', pendingStepsNumber: -1, skippedStepsNumber: -1, sortingMethod: 'ALPHABETICAL', undefinedStepsNumber: -1 } } } From 72e1cee9d5c2ffa9def86afb8a4e8bac9633c159 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Mon, 9 Oct 2023 20:19:34 -0700 Subject: [PATCH 5/5] split features into 2 separate feature files --- features/homepage.feature | 14 -------------- features/visit.feature | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 features/visit.feature diff --git a/features/homepage.feature b/features/homepage.feature index 9803b98..4a96c4a 100644 --- a/features/homepage.feature +++ b/features/homepage.feature @@ -33,17 +33,3 @@ Feature: Homepage And I click the "Submit" button Then I should be on "/create" page And I should see the message "Link exists" - - @db-test - Scenario: Accessing the URL based on the shortcode - Given A link already exists with the url "https://google.com" and code "aaaaaa" - When I visit the "/aaaaaa" location - Then I should be redirected to "https://google.com" - - Scenario: Accessing a nonexistent URL code - Given I visit the "/aaaaaa" location - Then I should be on "/aaaaaa" page - And The status code should be 404 - And I should see the message "Link aaaaaa doesn't exist" - And I should see a form field "url" - And I should see a "Submit" button diff --git a/features/visit.feature b/features/visit.feature new file mode 100644 index 0000000..b83d392 --- /dev/null +++ b/features/visit.feature @@ -0,0 +1,19 @@ +# features/visit.feature + +Feature: Visit + +Accessing a URL from it's link code + + @db-test + Scenario: Accessing the URL based on the shortcode + Given A link already exists with the url "https://google.com" and code "aaaaaa" + When I visit the "/aaaaaa" location + Then I should be redirected to "https://google.com" + + Scenario: Accessing a nonexistent URL code + Given I visit the "/aaaaaa" location + Then I should be on "/aaaaaa" page + And The status code should be 404 + And I should see the message "Link aaaaaa doesn't exist" + And I should see a form field "url" + And I should see a "Submit" button