-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
11 changed files
with
131 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from django.test import override_settings | ||
from playwright.sync_api import expect | ||
|
||
from tests.test_frontend.conftest import PlaywrightTestBase | ||
|
||
|
||
class TestEnvironmentBanner(PlaywrightTestBase): | ||
"""Tests the non-production banner appears""" | ||
|
||
@override_settings(ENVIRONMENT="production", DEBUG=False) | ||
def test_banner_does_not_appear_on_production(self): | ||
self.page.goto(self.base_url) | ||
expect(self.page.get_by_test_id("environment_banner")).to_be_hidden() | ||
|
||
@override_settings(ENVIRONMENT="production", DEBUG=True) | ||
def test_banner_does_not_appear_debug_true(self): | ||
self.page.goto(self.base_url) | ||
expect(self.page.get_by_test_id("environment_banner")).to_be_hidden() | ||
|
||
@override_settings(ENVIRONMENT="local", DEBUG=True) | ||
def test_banner_appears(self): | ||
self.page.goto(self.base_url) | ||
expect(self.page.get_by_test_id("environment_banner")).to_be_visible() | ||
expect(self.page.get_by_text("Environment: local")).to_be_visible() | ||
|
||
@override_settings(ENVIRONMENT="local", DEBUG=True, CURRENT_BRANCH="test-branch", CURRENT_TAG="v1.0.0") | ||
def test_banner_content(self): | ||
self.page.goto(self.base_url) | ||
expect(self.page.get_by_text("Environment: local")).to_be_visible() | ||
expect(self.page.get_by_text("Branch: test-branch")).to_be_visible() | ||
expect(self.page.get_by_text("Tag: v1.0.0")).to_be_visible() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters