Skip to content

Commit 7ccf4a6

Browse files
authored
Merge pull request #129 from docusign/feature/fixes-for-selenium-tests
Fixes for selenium tests
2 parents c61579c + 6afae8e commit 7ccf4a6

File tree

7 files changed

+31
-23
lines changed

7 files changed

+31
-23
lines changed

app/admin/examples/eg004_add_users_via_bulk_import.py

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88

99

1010
class Eg004AddUsersViaBulkImportController:
11+
@staticmethod
12+
def get_example_csv():
13+
"""
14+
Creates an example of a CSV file, such as that needs to be sent to the Docusign server
15+
"""
16+
17+
# Returns an example of a CSV file
18+
return (
19+
"AccountID,UserName,UserEmail,PermissionSet\n"
20+
f"{session['ds_account_id']},Example User1,exampleuser1@example.com,DS Admin\n"
21+
f"{session['ds_account_id']},Example User2,exampleuser2@example.com,DS Admin\n"
22+
)
1123

1224
@staticmethod
1325
def worker(self, request):
@@ -35,7 +47,16 @@ def worker(self, request):
3547
uploaded_file = request.files['csv_file']
3648
csv_folder_path = path.abspath(path.join(path.dirname(path.realpath(__file__)), "csv"))
3749
csv_file_path = path.join(csv_folder_path, "uploaded_file.csv")
38-
uploaded_file.save(csv_file_path)
50+
51+
if uploaded_file and not uploaded_file.filename == '':
52+
uploaded_file.save(csv_file_path)
53+
else:
54+
content = Eg004AddUsersViaBulkImportController.get_example_csv()
55+
56+
modified_content = content.replace("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", session["ds_account_id"])
57+
58+
with open(csv_file_path, "w") as file:
59+
file.write(modified_content)
3960

4061
# Creating an import API object
4162
#ds-snippet-start:Admin4Step3
@@ -57,19 +78,6 @@ def worker(self, request):
5778

5879
return response
5980

60-
@staticmethod
61-
def get_example_csv():
62-
"""
63-
Creates an example of a CSV file, such as that needs to be sent to the Docusign server
64-
"""
65-
66-
# Returns an example of a CSV file
67-
return (
68-
"AccountID,UserName,UserEmail,PermissionSet\n"
69-
f"{session['ds_account_id']},Example User1,exampleuser1@example.com,DS Admin\n"
70-
f"{session['ds_account_id']},Example User2,exampleuser2@example.com,DS Admin\n"
71-
)
72-
7381
@staticmethod
7482
def check_status():
7583
"""Check request status"""

app/click/examples/eg006_embed_clickwrap.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def get_args():
1717
"email": request.form.get("email"),
1818
"company": request.form.get("company"),
1919
"title": request.form.get("title"),
20-
"date": request.form.get("date"),
20+
"date": request.form.get("date"),
21+
"statuses": ["inactive", "draft"]
2122
}
2223

2324
@staticmethod

app/click/views/eg004_list_clickwraps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def clickwrap_list():
4343
"example_done.html",
4444
title=example["ExampleName"],
4545
message="Results from the ClickWraps::getClickwraps method:",
46-
json=json.dumps(json.dumps(results.to_dict(), default=str))
46+
json=json.dumps(json.dumps(results, default=str))
4747
)
4848

4949

app/monitor/views/eg001_get_monitoring_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_monitoring_data():
4141
"example_done.html",
4242
title=example["ExampleName"],
4343
message="Results from DataSet:getStream method:",
44-
json=json.dumps(json.dumps(results, default=str))
44+
json=json.dumps(json.dumps(results, default=str).replace('\\"', '').replace("'", ""))
4545
)
4646

4747
@meg001.route(f"/{eg}", methods=["GET"])

app/templates/admin/eg004_add_users_via_bulk_import.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<form class="eg" action="" method="post" data-busy="form" enctype="multipart/form-data">
99
<div class="form-group">
10-
<input type="file" name="csv_file" required>
10+
<input type="file" name="csv_file" id="csv_file">
1111
</div>
1212
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
1313
<button type="submit" class="btn btn-docu mt-4 mb-4">Continue</button>

app/templates/admin/eg008_update_user_product_permission_profile.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
{% set form_index = 0 %}
66
{% set product_index = 0 %}
7-
{% set esign_permission_index = 1 %}
8-
{% set clm_permission_index = 2 %}
7+
{% set permission_index = 1 %}
98
{% set redirect_to2_index = 0 %}
109

1110
{% if email_ok %}
@@ -29,7 +28,7 @@
2928

3029
{% if esign_permission_profiles_list %}
3130
<div class="form-group" id="esign-profiles" style="display: none">
32-
<label for="esign_permission_profile">{{ example['Forms'][form_index]['Inputs'][esign_permission_index]['InputName'] }}</label>
31+
<label for="esign_permission_profile">{{ example['Forms'][form_index]['Inputs'][permission_index]['InputName'] }}</label>
3332
<select class="form-control" id="esign_permission_profile" name="esign_permission_profile">
3433
{% for profile in esign_permission_profiles_list %}
3534
<option value="{{profile.permission_profile_id}}">{{profile.permission_profile_name}}</option>
@@ -43,7 +42,7 @@
4342

4443
{% if clm_permission_profiles_list %}
4544
<div class="form-group" id="clm-profiles">
46-
<label for="clm_permission_profile">{{ example['Forms'][form_index]['Inputs'][clm_permission_index]['InputName'] }}</label>
45+
<label for="clm_permission_profile">{{ example['Forms'][form_index]['Inputs'][permission_index]['InputName'] }}</label>
4746
<select class="form-control" id="clm_permission_profile" name="clm_permission_profile">
4847
{% for profile in clm_permission_profiles_list %}
4948
<option value="{{profile.permission_profile_id}}">{{profile.permission_profile_name}}</option>

app/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
def index():
2121
session["manifest"] = get_manifest(DS_CONFIG["example_manifest_url"])
2222

23-
if DS_CONFIG["quickstart"] == "true":
23+
if DS_CONFIG["quickstart"] == "true" and ("quickstart" not in app.config or ( "quickstart" in app.config and app.config["quickstart"] == True)):
2424
app.config["quickstart"] = False
2525
return redirect(url_for("eg001.get_view"))
2626
if "is_cfr" in session and session["is_cfr"] == "enabled":

0 commit comments

Comments
 (0)