Skip to content

Commit

Permalink
Corrections to automated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mollybsmith-noaa committed Jun 21, 2024
1 parent 2338aa3 commit e633d14
Show file tree
Hide file tree
Showing 19 changed files with 180 additions and 44 deletions.
4 changes: 2 additions & 2 deletions apps/surfrad/server/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ const doCurveParams = function () {
.split(",")
.map(Function.prototype.call, String.prototype.trim)
.map(function (fhr) {
return Number(fhr.replace(/'|\[|\]/g, "")) / 60;
return (Number(fhr.replace(/'|\[|\]/g, "")) / 60).toString();
});

const scales = rows[i].scle;
Expand Down Expand Up @@ -680,7 +680,7 @@ const doCurveParams = function () {
superiorNames: ["data-source"],
controlButtonCovered: true,
unique: false,
default: scaleModelOptionsMap[Object.keys(scaleModelOptionsMap)[0]][1],
default: scaleModelOptionsMap[Object.keys(scaleModelOptionsMap)[0]][0],
controlButtonVisibility: "block",
displayOrder: 3,
displayPriority: 1,
Expand Down
4 changes: 2 additions & 2 deletions tests/src/features/surfrad/basic/addRemoveContour.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Feature: Add Remove Contour
Scenario: addRemoveContour
When I set the plot type to "Contour"
Then the plot type should be "Contour"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
4 changes: 2 additions & 2 deletions tests/src/features/surfrad/basic/addRemoveContourDiff.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Feature: Add Remove ContourDiff
Scenario: addRemoveContourDiff
When I set the plot type to "ContourDiff"
Then the plot type should be "ContourDiff"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
4 changes: 2 additions & 2 deletions tests/src/features/surfrad/basic/addRemoveCurve.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Feature: Add Remove Curve
Scenario: addRemoveCurve
When I set the plot type to "TimeSeries"
Then the plot type should be "TimeSeries"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Feature: Add Remove DailyModelCycle Curve
Scenario: addRemoveDailyModelCycleCurve
When I set the plot type to "DailyModelCycle"
Then the plot type should be "DailyModelCycle"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
39 changes: 39 additions & 0 deletions tests/src/features/surfrad/basic/addRemoveDieOffCurve.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Feature: Add Remove Dieoff Curve

As an unauthenticated user to the app,
with the app in its default state,
I want click the dieoff radio button,
I want to set the forecast-length selector to dieoff
I want to add one curve
then plot that curve and see the graph,
then go back to the curve management page,
then delete that curve.

Background:
Given I load the app "/surfrad"
Then I expect the app title to be "Surface Radiation"

@watch
Scenario: addRemoveDieoffCurve
When I set the plot type to "Dieoff"
Then the plot type should be "Dieoff"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Then "Curve0" is added
And I should see a list of curves containing "Curve0"

When I click the "Plot Unmatched" button
Then I should be on the graph page
And I should have a "Dieoff" plot

When I click the "Back" button
Then I should be on the main page
And the "Plot Unmatched" button should be visible

Then I click the "Remove Curve0" button
And the "Remove curve Curve0" button should be visible
Then I click the "Remove curve Curve0" button
Then I should have 0 curves
4 changes: 2 additions & 2 deletions tests/src/features/surfrad/basic/addRemoveHistogram.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Feature: Add Remove Histogram
Scenario: addRemoveHistogram
When I set the plot type to "Histogram"
Then the plot type should be "Histogram"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
12 changes: 6 additions & 6 deletions tests/src/features/surfrad/basic/addRemoveScatter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Feature: Add Remove Scatter
Scenario: addRemoveScatter
When I set the plot type to "SimpleScatter"
Then the plot type should be "SimpleScatter"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I change the "x-statistic" parameter to "Bias (Model - Obs)"
Then the "x-statistic" parameter value matches "Bias (Model - Obs)"
When I change the "x-variable" parameter to "dswrf"
Then the "x-variable" parameter value matches "dswrf"
When I change the "x-variable" parameter to "Downward Shortwave Radiation Flux (W/m2)"
Then the "x-variable" parameter value matches "Downward Shortwave Radiation Flux (W/m2)"
When I change the "y-statistic" parameter to "Obs average"
Then the "y-statistic" parameter value matches "Obs average"
When I change the "y-variable" parameter to "dswrf"
Then the "y-variable" parameter value matches "dswrf"
When I change the "y-variable" parameter to "Downward Shortwave Radiation Flux (W/m2)"
Then the "y-variable" parameter value matches "Downward Shortwave Radiation Flux (W/m2)"
When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
4 changes: 2 additions & 2 deletions tests/src/features/surfrad/basic/addRemoveTwoCurves.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Feature: Add Remove Two Curves
Scenario: addRemoveTwoCurves
When I set the plot type to "TimeSeries"
Then the plot type should be "TimeSeries"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
12 changes: 6 additions & 6 deletions tests/src/features/surfrad/basic/addRemoveTwoScatters.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ Feature: Add Remove Two Scatters
Scenario: addRemoveTwoScatters
When I set the plot type to "SimpleScatter"
Then the plot type should be "SimpleScatter"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I change the "x-statistic" parameter to "Bias (Model - Obs)"
Then the "x-statistic" parameter value matches "Bias (Model - Obs)"
When I change the "x-variable" parameter to "dswrf"
Then the "x-variable" parameter value matches "dswrf"
When I change the "x-variable" parameter to "Downward Shortwave Radiation Flux (W/m2)"
Then the "x-variable" parameter value matches "Downward Shortwave Radiation Flux (W/m2)"
When I change the "y-statistic" parameter to "Obs average"
Then the "y-statistic" parameter value matches "Obs average"
When I change the "y-variable" parameter to "dswrf"
Then the "y-variable" parameter value matches "dswrf"
When I change the "y-variable" parameter to "Downward Shortwave Radiation Flux (W/m2)"
Then the "y-variable" parameter value matches "Downward Shortwave Radiation Flux (W/m2)"
When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Feature: Add Remove Valid Time Curve
Scenario: addRemoveValidTimeCurve
When I set the plot type to "ValidTime"
Then the plot type should be "ValidTime"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Feature: addThreeCurvesRemoveOneCurveAddAnotherCurve
Scenario: addThreeCurvesRemoveOneCurveAddAnotherCurve
When I set the plot type to "TimeSeries"
Then the plot type should be "TimeSeries"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand All @@ -30,8 +30,8 @@ Feature: addThreeCurvesRemoveOneCurveAddAnotherCurve
Then I click the "Add Curve" button
Then "Curve1" is added

When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I change the "data-source" parameter to "NAM"
Then the "data-source" parameter value matches "NAM"
When I click the "Add Curve" button
Then "Curve2" is added
And I should see a list of curves containing "Curve0,Curve1,Curve2"
Expand Down
4 changes: 2 additions & 2 deletions tests/src/features/surfrad/basic/histogramBinSpacings.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Feature: Histogram Bin Spacings
Scenario: histogramBinSpacings
When I set the plot type to "Histogram"
Then the plot type should be "Histogram"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
Then I click the "Add Curve" button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Feature: Match Unmatch Diff Curves DailyModelCycle
Scenario: matchUnmatchDiffCurvesDailyModelCycle
When I set the plot type to "DailyModelCycle"
Then the plot type should be "DailyModelCycle"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
When I click the "Add Curve" button
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Feature: Match Unmatch Diff Curves Dieoff

As an unauthenticated user to the app,
with the app in its default state so that the plots are Dieoff,
I want to add two curves, plot unmatched, and then return to the main page.
I then want to add a matched difference curve, plot unmatched, return to the main page, plot matched, and then return to the main page.
I then want to add a piecewise difference curve, plot unmatched, return to the main page, plot matched, and then return to the main page.
I want to end by removing all of the curves.

Background:
Given I load the app "/surfrad"
Then I expect the app title to be "Surface Radiation"

@watch
Scenario: matchUnmatchDiffCurvesDieoff
When I set the plot type to "Dieoff"
Then the plot type should be "Dieoff"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
When I change the "dieoff-type" parameter to "Dieoff for a specified UTC cycle init hour"
Then the "dieoff-type" parameter value matches "Dieoff for a specified UTC cycle init hour"
When I click the "Add Curve" button
Then "Curve0" is added

When I change the "data-source" parameter to "RAP_OPS_130"
Then the "data-source" parameter value matches "RAP_OPS_130"
When I click the "Add Curve" button
Then "Curve1" is added
And I should see a list of curves containing "Curve0,Curve1"

When I click the "Plot Unmatched" button
Then I should be on the graph page
And I should have a "Dieoff" plot

When I click the "Back" button
Then I should be on the main page
And the "Plot Unmatched" button should be visible

When I click the "Plot Matched" button
Then I should be on the graph page
And I should have a "Dieoff" plot

When I click the "Back" button
Then I should be on the main page
And the "Plot Matched" button should be visible

When I click the "matching diffs" radio button
Then "Curve1-Curve0" is added
And I should see a list of curves containing "Curve0,Curve1,Curve1-Curve0"

When I click the "Plot Unmatched" button
Then I should be on the graph page
And I should have a "Dieoff" plot

When I click the "Back" button
Then I should be on the main page
And the "Plot Unmatched" button should be visible

When I click the "Plot Matched" button
Then I should be on the graph page
And I should have a "Dieoff" plot

When I click the "Back" button
Then I should be on the main page
And the "Plot Matched" button should be visible

When I click the "pairwise diffs" radio button
Then the plot format should be "pairwise"
Then I should see a list of curves containing "Curve0,Curve1,Curve1-Curve0"
And I should have 3 curves

When I click the "Plot Unmatched" button
Then I should be on the graph page
And I should have a "Dieoff" plot

When I click the "Back" button
Then I should be on the main page
And the "Plot Unmatched" button should be visible

When I click the "Plot Matched" button
Then I should be on the graph page
And I should have a "Dieoff" plot

When I click the "Back" button
Then I should be on the main page
And the "Plot Matched" button should be visible

When I click the "no diffs" radio button
Then I should see a list of curves containing "Curve0,Curve1"
And I should have 2 curves

When I click the "Remove All" button
And the "Remove all the curves" button should be visible
Then I click the "Remove all the curves" button
Then I should have 0 curves
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Feature: Match Unmatch Diff Curves Histogram
Scenario: matchUnmatchDiffCurvesHistogram
When I set the plot type to "Histogram"
Then the plot type should be "Histogram"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
When I click the "Add Curve" button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Feature: Match Unmatch Diff Curves Timeseries
Scenario: matchUnmatchDiffCurvesTimeseries
When I set the plot type to "TimeSeries"
Then the plot type should be "TimeSeries"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
When I click the "Add Curve" button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Feature: Match Unmatch Diff Curves Valid Time
Scenario: matchUnmatchDiffCurvesValidTime
When I set the plot type to "ValidTime"
Then the plot type should be "ValidTime"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00"
Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00"
When I click the "Add Curve" button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Feature: No Data Found Exception: invalid_times
Scenario: noDataFoundException_invalid_times
When I set the plot type to "TimeSeries"
Then the plot type should be "TimeSeries"
When I change the "data-source" parameter to "RAP_GSL_130"
Then the "data-source" parameter value matches "RAP_GSL_130"
When I change the "data-source" parameter to "HRRR_OPS"
Then the "data-source" parameter value matches "HRRR_OPS"
When I set the dates to "01/19/1995 12:00 - 06/19/1996 12:00"
Then the dates value is "01/19/1995 12:00 - 06/19/1996 12:00"
When I click the "Add Curve" button
Expand Down

0 comments on commit e633d14

Please sign in to comment.