Skip to content

Commit

Permalink
♻️ Refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
ecureuill committed Feb 21, 2024
1 parent c9bea85 commit d065b59
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
9 changes: 5 additions & 4 deletions tests/e2e/admin/leads/search.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@ Documentation Admin Leads Page - test suit for Search Lead feature
Resource ../../../../resources/pages/BasePage.resource
Resource ../../../../resources/pages/AdminLeadsPage.resource
Resource ../../../../resources/pages/AdminLoginPage.resource
Test Setup Test Setup ${LEADS_DATA}
Suite Setup Suite Setup leads_data=${LEADS_DATA}
Test Setup Test Setup
Test Teardown Take Screenshot fullPage=True

*** Variables ***
${LEADS_DATA}

*** Keywords ***
Test Setup
Suite Setup
[Arguments] ${leads_data}

DB.Execute Sql sql=DELETE FROM leads

${value} Get Fixture
... file_name=leads
... scenario=search_feature
Set Test Variable ${leads_data} ${value}
Set Suite Variable ${leads_data} ${value}

FOR ${movie} IN @{leads_data}[data]
Create Lead payload=${movie}
END

Test Setup
${value} Get Fixture
... file_name=login
... scenario=success
Expand Down
11 changes: 6 additions & 5 deletions tests/e2e/admin/movies/search.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,29 @@ Documentation Admin Movies Page - test suit for Search Movie feature
Resource ../../../../resources/pages/BasePage.resource
Resource ../../../../resources/pages/AdminMoviesPage.resource
Resource ../../../../resources/pages/AdminLoginPage.resource
Test Setup Test Setup ${MOVIES_DATA}
Suite Setup Suite Setup ${MOVIES_DATA}
Test Setup Test Setup
Test Teardown Take Screenshot fullPage=True

*** Variables ***
${MOVIES_DATA}

*** Keywords ***
Test Setup
Suite Setup
[Arguments] ${movies_data}

DB.Execute Sql sql=DELETE FROM movies

${value} Get Fixture
... file_name=movies
... scenario=search_feature
Set Test Variable ${movies_data} ${value}
Set Suite Variable ${movies_data} ${value}

FOR ${movie} IN @{movies_data}[data]
Create Movie movie_data=${movie}
END

${value} Get Fixture
Test Setup
${value} Get Fixture
... file_name=login
... scenario=success

Expand Down
10 changes: 6 additions & 4 deletions tests/e2e/admin/tvshows/search.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@ Documentation Admin Tv Shows Page - test suit for Search feature
Resource ../../../../resources/pages/BasePage.resource
Resource ../../../../resources/pages/AdminTvShowsPage.resource
Resource ../../../../resources/pages/AdminLoginPage.resource
Test Setup Test Setup ${TVSHOWS_DATA}
Suite Setup Suite Setup tvshows_data=${TVSHOWS_DATA}
Test Setup Test Setup
Test Teardown Take Screenshot fullPage=True

*** Variables ***
${TVSHOWS_DATA}

*** Keywords ***
Test Setup
Suite Setup
[Arguments] ${tvshows_data}

DB.Execute Sql sql=DELETE FROM tvshows

${value} Get Fixture
... file_name=tvshows
... scenario=search_feature
Set Test Variable ${tvshows_data} ${value}
Set Suite Variable ${tvshows_data} ${value}

FOR ${tvshows} IN @{tvshows_data}[data]
Create Tvshow tvshow_data=${tvshows}
END

Test Setup
${value} Get Fixture
... file_name=login
... scenario=success
Expand Down

0 comments on commit d065b59

Please sign in to comment.