@@ -7,7 +7,7 @@ REPORT_STATUS_NOT_AVAILABLE="NOT_AVAILABLE"
7
7
REPORT_STATUS_TEST_AVAILABLE=" TEST_AVAILABLE"
8
8
REPORT_STATUS_IN_PROGRESS=" IN_PROGRESS"
9
9
REQUESTING_CI=" circle-ci"
10
- REPORT_FORMAT=" [\" basicHtml \" , \" richHtml\" ]" # need to verify to add plainText as well
10
+ REPORT_FORMAT=" [\" plainText \" , \" richHtml\" ]"
11
11
12
12
# Error scenario mappings
13
13
declare -A ERROR_SCENARIOS=(
@@ -22,26 +22,6 @@ if [[ -z "$BROWSERSTACK_BUILD_NAME" ]]; then
22
22
exit 0
23
23
fi
24
24
25
- # Function to install html2text
26
- install_html2text () {
27
- echo " Checking and installing html2text if not installed..."
28
- if ! command -v html2text & > /dev/null; then
29
- echo " html2text not found. Installing..."
30
- if command -v apt-get & > /dev/null; then
31
- sudo apt-get update && sudo apt-get install -y html2text
32
- elif command -v yum & > /dev/null; then
33
- sudo yum install -y html2text
34
- else
35
- echo " Package manager not supported. Please install html2text manually."
36
- exit 0
37
- fi
38
- else
39
- echo " html2text is already installed."
40
- fi
41
- }
42
-
43
- install_html2text
44
-
45
25
# Function to make API requests
46
26
make_api_request () {
47
27
local request_type=$1
@@ -84,7 +64,7 @@ extract_report_data() {
84
64
local response=$1
85
65
rich_html_response=$( echo " $response " | jq -r ' .report.richHtml // empty' )
86
66
rich_css_response=$( echo " $response " | jq -r ' .report.richCss // empty' )
87
- basic_html_response =$( echo " $response " | jq -r ' .report.basicHtml // empty' )
67
+ plain_text_response =$( echo " $response " | jq -r ' .report.plainText // empty' )
88
68
}
89
69
90
70
# Function to check report status
@@ -173,20 +153,13 @@ $rich_html_response
173
153
</html>" > browserstack/cadreport.html
174
154
echo " Rich html report saved as browserstack/cadreport.html. To view the report, open artifacts tab & click on cadreport.html"
175
155
176
- # Generate basic text report
177
- if [[ -n " $basic_html_response " ]]; then
178
- # Wrap basic_html_response with DOCTYPE html and body tags
179
- basic_html_response=" <!DOCTYPE html><html>$basic_html_response /html>"
180
-
181
- if command -v html2text & > /dev/null; then
182
- basic_text_report=$( echo " $basic_html_response " | html2text)
183
- echo " Basic report (text format):"
184
- echo " $basic_text_report "
185
- else
186
- echo " html2text not installed. Skipping text report generation."
187
- fi
156
+ # Generate plain text report
157
+ if [[ -n " $plain_text_response " ]]; then
158
+ echo " "
159
+ echo " Browserstack textual report"
160
+ echo " $plain_text_response "
188
161
else
189
- echo " Basic HTML response is empty."
162
+ echo " Plain text response is empty."
190
163
fi
191
164
elif [[ " $REPORT_STATUS " == " $REPORT_STATUS_NOT_AVAILABLE " ]]; then
192
165
error_reason=$( echo " $RESPONSE " | jq -r ' .body.errorReason // empty' )
0 commit comments