Skip to content

Commit 643f4ca

Browse files
gtosellilucagiove
authored andcommitted
refactor(atests): remove hardcoded localhost:5000 url
1 parent b65bc53 commit 643f4ca

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

atests/test_headers.robot

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ Suite Setup Setup Flask Http Server
88
Suite Teardown Teardown Flask Http Server And Sessions
99

1010

11-
*** Variables ***
12-
${HTTP_LOCAL_SERVER} http://localhost:5000
13-
14-
1511
*** Test Cases ***
1612
Get Request With Session Headers
1713
[Tags] get headers

atests/test_requests.robot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ Get Request And Fail By Default On Http Error
8787

8888
Get Request And Fail By Expecting A 200 Status
8989
[Tags] get
90-
Run Keyword And Expect Error Url: http://localhost:5000/status/404?param Expected status: 404 != 200
90+
Run Keyword And Expect Error Url: ${HTTP_LOCAL_SERVER}/status/404?param Expected status: 404 != 200
9191
... GET ${HTTP_LOCAL_SERVER}/status/404 param 200
9292

9393
Get Request And Fail By Expecting A 200 Status With A Message
9494
[Tags] get
95-
Run Keyword And Expect Error Custom msg Url: http://localhost:5000/status/404?param Expected status: 404 != 200
95+
Run Keyword And Expect Error Custom msg Url: ${HTTP_LOCAL_SERVER}/status/404?param Expected status: 404 != 200
9696
... GET ${HTTP_LOCAL_SERVER}/status/404 param 200 Custom msg
9797

9898
Get Request Expect An Error And Evaluate Response

atests/test_requests_on_session.robot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ Get Request And Fail By Default On Http Error
8787

8888
Get Request And Fail By Expecting A 200 Status
8989
[Tags] get
90-
Run Keyword And Expect Error Url: http://localhost:5000/status/404?param Expected status: 404 != 200
90+
Run Keyword And Expect Error Url: ${HTTP_LOCAL_SERVER}/status/404?param Expected status: 404 != 200
9191
... GET On Session ${GLOBAL_SESSION} /status/404 param 200
9292

9393
Get Request And Fail By Expecting A 200 Status With A Message
9494
[Tags] get
95-
Run Keyword And Expect Error Custom msg Url: http://localhost:5000/status/404?param Expected status: 404 != 200
95+
Run Keyword And Expect Error Custom msg Url: ${HTTP_LOCAL_SERVER}/status/404?param Expected status: 404 != 200
9696
... GET On Session ${GLOBAL_SESSION} /status/404 param 200 Custom msg
9797

9898
Get Request Expect An Error And Evaluate Response

atests/test_retries.robot

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ Suite Setup Setup Flask Http Server
88
Suite Teardown Teardown Flask Http Server And Sessions
99

1010

11-
*** Variables ***
12-
${HTTP_LOCAL_SERVER} http://localhost:5000
13-
14-
1511
*** Test Cases ***
1612
Retry Session With Wrong Retry Status List
1713
[Tags] session retry

atests/test_status_assertions.robot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Suite Teardown Teardown Flask Http Server And Sessions
1111
Request And Status Should Be Different
1212
[Tags] get status
1313
${resp}= Get Request ${GLOBAL_SESSION} /status/404
14-
Run Keyword And Expect Error Url: http://localhost:5000/status/404 Expected status: 404 != 201 Status Should Be 201 ${resp}
14+
Run Keyword And Expect Error Url: ${HTTP_LOCAL_SERVER}/status/404 Expected status: 404 != 201 Status Should Be 201 ${resp}
1515

1616
Request And Status Should Be Equal
1717
[Tags] get status
@@ -36,7 +36,7 @@ Invalid Response
3636
Request And Status Should Be With A Message
3737
[Tags] get status
3838
${resp}= Get Request ${GLOBAL_SESSION} /status/418
39-
Run Keyword And Expect Error It should be a teapot! Url: http://localhost:5000/status/418 Expected status: 418 != 200
39+
Run Keyword And Expect Error It should be a teapot! Url: ${HTTP_LOCAL_SERVER}/status/418 Expected status: 418 != 200
4040
... Status Should Be OK ${resp} It should be a teapot!
4141

4242
Request Should Be Successful
@@ -85,7 +85,7 @@ Assert Status Should Be OK On The Last Request
8585
Assert Status Should Be Fail On The Last Request
8686
[Tags] post status
8787
POST On Session ${GLOBAL_SESSION} /status/500 expected_status=500
88-
Run Keyword And Expect Error Url: http://localhost:5000/status/500 Expected status: 500 != 200 Status Should Be OK
88+
Run Keyword And Expect Error Url: ${HTTP_LOCAL_SERVER}/status/500 Expected status: 500 != 200 Status Should Be OK
8989

9090
Assert Successful On The Last Session-Less Request
9191
[Tags] put status
@@ -117,4 +117,4 @@ Assert Status Should Be OK On The Last Session-Less Request
117117
Assert Status Should Be Fail On The Last Session-Less Request
118118
[Tags] post status
119119
POST ${HTTP_LOCAL_SERVER}/status/500 expected_status=500
120-
Run Keyword And Expect Error Url: http://localhost:5000/status/500 Expected status: 500 != 200 Status Should Be OK
120+
Run Keyword And Expect Error Url: ${HTTP_LOCAL_SERVER}/status/500 Expected status: 500 != 200 Status Should Be OK

0 commit comments

Comments
 (0)