mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 23:18:24 -04:00
End to end woes continue.
Signed-off-by: Cliff Hill <clifford.hill@gsa.gov>
This commit is contained in:
@@ -15,11 +15,13 @@ from app.models.service import Service
|
|||||||
from app.models.user import User
|
from app.models.user import User
|
||||||
from app.notify_client.service_api_client import service_api_client
|
from app.notify_client.service_api_client import service_api_client
|
||||||
from app.notify_client.user_api_client import user_api_client
|
from app.notify_client.user_api_client import user_api_client
|
||||||
|
from notifications_python_client.errors import HTTPError
|
||||||
from .. import TestClient
|
from .. import TestClient
|
||||||
|
|
||||||
|
|
||||||
E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI")
|
E2E_TEST_URI = os.getenv("NOTIFY_E2E_TEST_URI")
|
||||||
|
|
||||||
|
|
||||||
class TestClient(FlaskClient):
|
class TestClient(FlaskClient):
|
||||||
def login(self, user, mocker=None, service=None):
|
def login(self, user, mocker=None, service=None):
|
||||||
# Skipping authentication here and just log them in
|
# Skipping authentication here and just log them in
|
||||||
@@ -112,7 +114,7 @@ def client(notify_admin_e2e, default_user):
|
|||||||
|
|
||||||
|
|
||||||
# Need e2e service defined here?
|
# Need e2e service defined here?
|
||||||
@pytest.fixture
|
@pytest.fixture()
|
||||||
def default_service(browser, client, default_user):
|
def default_service(browser, client, default_user):
|
||||||
current_date_time = datetime.datetime.now()
|
current_date_time = datetime.datetime.now()
|
||||||
now = current_date_time.strftime("%m/%d/%Y %H:%M:%S")
|
now = current_date_time.strftime("%m/%d/%Y %H:%M:%S")
|
||||||
@@ -120,20 +122,27 @@ def default_service(browser, client, default_user):
|
|||||||
service_name = f"E2E Federal Test Service {now} - {browser_type}"
|
service_name = f"E2E Federal Test Service {now} - {browser_type}"
|
||||||
|
|
||||||
service_id = service_api_client.create_service(
|
service_id = service_api_client.create_service(
|
||||||
service_name,
|
service_name=service_name,
|
||||||
"federal",
|
organization_type="federal",
|
||||||
current_app.config["DEFAULT_SERVICE_LIMIT"],
|
message_limit=current_app.config["DEFAULT_SERVICE_LIMIT"],
|
||||||
True,
|
restricted=True,
|
||||||
default_user["id"],
|
user_id=default_user["id"],
|
||||||
default_user["email_address"],
|
email_from=default_user["email_address"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
print("*" * 80)
|
||||||
|
print(service_id)
|
||||||
|
|
||||||
service_data = service_api_client.get_service(service_id)
|
service_data = service_api_client.get_service(service_id)
|
||||||
|
|
||||||
service = Service(service_data)
|
service = Service(service_data)
|
||||||
|
|
||||||
yield service
|
from pprint import pprint
|
||||||
|
pprint(dir(service))
|
||||||
|
|
||||||
|
try:
|
||||||
|
yield service
|
||||||
|
finally:
|
||||||
service_api_client.archive_service(service.id, None)
|
service_api_client.archive_service(service.id, None)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -208,6 +208,10 @@ def test_campaign_manager_core_user_story(default_service, end_to_end_context):
|
|||||||
# service_heading = page.get_by_text(new_service_name, exact=True)
|
# service_heading = page.get_by_text(new_service_name, exact=True)
|
||||||
# expect(service_heading).to_be_visible()
|
# expect(service_heading).to_be_visible()
|
||||||
|
|
||||||
|
print("*" * 80)
|
||||||
|
print(default_service.name)
|
||||||
|
print("*" * 80)
|
||||||
|
|
||||||
expect(page).to_have_title(re.compile(default_service.name))
|
expect(page).to_have_title(re.compile(default_service.name))
|
||||||
|
|
||||||
create_new_template(page)
|
create_new_template(page)
|
||||||
|
|||||||
Reference in New Issue
Block a user