Skip to content

Commit cce3768

Browse files
authored
Merge pull request #2177 from gulfofmaine/redirect-tests
Test that redirects are followed and update old URLs
2 parents df4d98b + 55d2865 commit cce3768

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

cypress/e2e/Platform/44007_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("Platfrom 44007", () => {
4141
cy.get("[href='/platform/44007/observations/wind']").first().click()
4242
cy.get("h4").contains("Wind")
4343
cy.get("svg.highcharts-root")
44-
cy.get("svg.highcharts-root").contains("Gust").click()
44+
// cy.get("svg.highcharts-root").contains("Gust").click()
4545
cy.get("svg.highcharts-root").contains("Speed").click()
4646
cy.get("svg.highcharts-root").contains("Direction").click()
4747
cy.get("svg.highcharts-root").contains("Knots")
@@ -111,6 +111,6 @@ describe("Platfrom 44007", () => {
111111
cy.contains("Observations").click()
112112
cy.contains("All Observations").click()
113113

114-
cy.contains("Wind Gust:")
114+
cy.contains("Wind Speed:")
115115
})
116116
})

cypress/e2e/Platform/a01_spec.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*global cy*/
22

3-
const platformUrl = "/platform/A01%20-%2044029"
3+
const platformUrl = "/platform/A01"
44

55
describe("Platform A01", () => {
66
it("Can get to from Home Page", () => {
@@ -12,6 +12,12 @@ describe("Platform A01", () => {
1212
cy.contains("A01").click()
1313

1414
cy.contains("Station A01")
15+
cy.contains("NDBC ID: 44029")
16+
})
17+
18+
it("Will get redirected", () => {
19+
cy.visit("/platform/A01%20-%2044029")
20+
cy.location("pathname").should("eq", platformUrl)
1521
})
1622

1723
it("Shows platform status", () => {
@@ -51,7 +57,7 @@ describe("Platform A01", () => {
5157
cy.visit(platformUrl)
5258

5359
cy.contains("Observations").click()
54-
cy.get('[href="/platform/A01 - 44029/observations/wind"]').first().click()
60+
cy.get('[href="/platform/A01/observations/wind"]').first().click()
5561
cy.get("h4").contains("Wind")
5662
cy.get("svg.highcharts-root")
5763
cy.get("svg.highcharts-root").contains("Gust").click()
@@ -72,7 +78,7 @@ describe("Platform A01", () => {
7278

7379
cy.contains("Forecasts loading")
7480
cy.get("#forecast").click()
75-
cy.get("[href='/platform/A01 - 44029/forecast/significant_wave_height']").click()
81+
cy.get("[href='/platform/A01/forecast/significant_wave_height']").click()
7682
cy.get("h4").contains("Significant Wave Height Forecast")
7783

7884
cy.get("svg.highcharts-root").contains("Feet")

cypress/e2e/Platform/m01_spec.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*global cy*/
22

3-
const platformUrl = "/platform/M01%20-%2044037"
3+
const platformUrl = "/platform/M01"
44

55
describe("Platfrom M01", () => {
6-
xit("Can get to from Home Page", () => {
6+
it("Can get to from Home Page", () => {
77
cy.visit("/")
88

99
cy.contains("Regions").click()
@@ -12,9 +12,15 @@ describe("Platfrom M01", () => {
1212
cy.contains("M01").click()
1313

1414
cy.contains("Station M01")
15+
cy.contains("NDBC ID: 44037")
1516
})
1617

17-
xit("Shows platform status", () => {
18+
it("Will get redirected", () => {
19+
cy.visit("/platform/M01%20-%2044037")
20+
cy.location("pathname").should("eq", platformUrl)
21+
})
22+
23+
it("Shows platform status", () => {
1824
cy.visit(platformUrl)
1925

2026
cy.contains("Lat:")
@@ -23,7 +29,7 @@ describe("Platfrom M01", () => {
2329
cy.contains("Last updated at:")
2430
})
2531

26-
xit("Shows current conditions", () => {
32+
it("Shows current conditions", () => {
2733
cy.visit(platformUrl)
2834

2935
cy.contains("Latest Conditions")
@@ -32,19 +38,19 @@ describe("Platfrom M01", () => {
3238
cy.get("[style='margin-top: 1rem;'] > :nth-child(2) .card").should("have.length.be.gte", 4)
3339
})
3440

35-
xit("Shows air temp plot", () => {
41+
it("Shows air temp plot", () => {
3642
cy.visit(platformUrl)
3743

3844
cy.contains("Air Temperature:").click()
3945

4046
cy.get("h4").contains("Air Temperature")
4147
})
4248

43-
xit("Shows wind plot", () => {
49+
it("Shows wind plot", () => {
4450
cy.visit(platformUrl)
4551

4652
cy.contains("Observations").click()
47-
cy.get('[href="/platform/M01 - 44037/observations/wind"]').first().click()
53+
cy.get('[href="/platform/M01/observations/wind"]').first().click()
4854
cy.get("h4").contains("Wind")
4955
cy.get("svg.highcharts-root")
5056
cy.get("svg.highcharts-root").contains("Gust").click()
@@ -53,12 +59,12 @@ describe("Platfrom M01", () => {
5359
cy.get("svg.highcharts-root").contains("Knots")
5460
})
5561

56-
xit("Shows wave forecast", () => {
62+
it("Shows wave forecast", () => {
5763
cy.visit(platformUrl)
5864

5965
cy.contains("Forecasts loading")
6066
cy.get("#forecast").click()
61-
cy.get("[href='/platform/M01 - 44037/forecast/significant_wave_height']").click()
67+
cy.get("[href='/platform/M01/forecast/significant_wave_height']").click()
6268
cy.get("h4").contains("Significant Wave Height Forecast")
6369

6470
cy.get("svg.highcharts-root").contains("Feet")
@@ -70,7 +76,7 @@ describe("Platfrom M01", () => {
7076
cy.get("svg.highcharts-root").contains("Bedford Institute Wave Model - Height").click()
7177
})
7278

73-
xit("Has More info menu", () => {
79+
it("Has More info menu", () => {
7480
cy.visit(platformUrl)
7581

7682
cy.contains("More info").click()
@@ -80,7 +86,7 @@ describe("Platfrom M01", () => {
8086
cy.contains("Tides")
8187
})
8288

83-
xit("Updated recently", () => {
89+
it("Updated recently", () => {
8490
cy.visit(platformUrl)
8591

8692
cy.contains("Observations").click()
@@ -100,7 +106,7 @@ describe("Platfrom M01", () => {
100106
})
101107
})
102108

103-
xit("Can view all observations", () => {
109+
it("Can view all observations", () => {
104110
cy.visit(platformUrl)
105111

106112
cy.contains("Observations").click()

cypress/e2e/Platform/mooring_location_regression_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
describe("Mooring location regressions", () => {
44
it("Finds the correct location for B01", () => {
5-
cy.visit("/platform/B01%20-%2044030")
5+
cy.visit("/platform/B01")
66
cy.get(".card-text").contains("Western Maine Shelf")
77
})
88

99
it("Finds the correct location for I01", () => {
10-
cy.visit("/platform/I01%20-%2044034")
10+
cy.visit("/platform/I01")
1111
cy.get(".card-text").contains("Eastern Maine Shelf")
1212
})
1313
})

0 commit comments

Comments
 (0)