Skip to content

Commit c9bd174

Browse files
committed
fix verifyAlert
1 parent 39fdea2 commit c9bd174

7 files changed

Lines changed: 58 additions & 14 deletions

File tree

content/selenium-api.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3816,6 +3816,15 @@ Selenium.prototype.doAssertAlert = function(message) {
38163816
});
38173817
};
38183818

3819+
Selenium.prototype.doVerifyAlert = function(message) {
3820+
return this.browserbot.getAlertMessage().then(function(actualMessage) {
3821+
if (message != actualMessage) {
3822+
return Promise.reject("did not match");
3823+
} else
3824+
return Promise.resolve(true);
3825+
});
3826+
};
3827+
38193828
// Modified confirm by SideeX comitters (Copyright 2017)
38203829
Selenium.prototype.doChooseCancelOnNextConfirmation = function() {
38213830
return this.browserbot.setNextConfirmationResult(false);

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "Selenium IDE alternative to record and export Selenium scripts. With reports & screenshots. Fast & open-source.",
33
"manifest_version": 2,
44
"name": "addon_name_placeholder",
5-
"version": "5.3.6",
5+
"version": "5.3.17",
66
"homepage_url":"https://www.katalon.com/",
77
"icons":
88
{

panel/index.html

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@
2626
<!-- TODO: Change the title bar text -->
2727
<title>Katalon Recorder</title>
2828

29-
<!-- Global site tag (gtag.js) - Google Analytics -->
30-
<script async src="https://www.googletagmanager.com/gtag/js?id=G-EPMKV6JV1B"></script>
31-
<script>
32-
window.dataLayer = window.dataLayer || [];
33-
function gtag(){dataLayer.push(arguments);}
34-
gtag('js', new Date());
35-
36-
gtag('config', 'G-EPMKV6JV1B');
37-
</script>
38-
3929
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,700|Roboto:400,500,700" rel="stylesheet">
4030

4131
<link rel="stylesheet" href="css/jquery-ui.min.css">
@@ -77,6 +67,8 @@
7767
<script type="text/javascript" src="js/katalon/codemirror-5.31.0/mode/xml/xml.js"></script>
7868
<script type="text/javascript" src="js/katalon/bowser.js"></script>
7969
<script type="text/javascript" src="js/katalon/papaparse.js"></script>
70+
71+
<script type="text/javascript" src="js/katalon/kar-extra.js"></script>
8072
</head>
8173
<!-- TODO: Make whole panel size flexible -->
8274

@@ -315,7 +307,7 @@ <h3 class="suite-container-title">
315307
<li id="reference-log"><a>Reference</a></li>
316308
</ul>
317309
<ul class="tabs">
318-
<li id="ka-open"><a><img src="../katalon/images/branding/ka_32x24px.png" alt="Katalon TestOps"/>TestOps</a></li>
310+
<li id="ka-open"><a><img src="../katalon/images/branding/ka_32x24px.png" alt="Katalon TestOps"/>Dashboard</a></li>
319311
<li id="save-log"><a title="Save logs as...">Save</a></li>
320312
<li id="clear-log"><a title="Clear logs">Clear</a></li>
321313
<li id="data-files-add-csv"><a title="Add CSV File">Add CSV</a></li>

panel/js/UI/log.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ class Log {
3232
this._write("[error] " + str, "log-error");
3333
};
3434

35+
appendA(str, id) {
36+
let a = document.createElement('a');
37+
a.setAttribute("href", "#");
38+
a.setAttribute("id", id);
39+
a.setAttribute("class", "katalon-link");
40+
a.textContent = str;
41+
this.container.appendChild(a);
42+
this.container.scrollIntoView(false);
43+
}
44+
3545
_write(str, className) {
3646
let textElement = document.createElement('h4');
3747
textElement.setAttribute("class", className);

panel/js/background/playback.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ function switchPS() {
738738
if (projects.length == 1) {
739739
var project = projects[0];
740740
uploadTestReportsToTestOps(null, project.id);
741+
} else {
742+
sideex_log.appendA('Upload this execution to Katalon TestOps', 'ka-upload-log');
741743
}
742744
})
743745
}
@@ -1266,7 +1268,8 @@ function isWindowMethodCommand(command) {
12661268
|| command == "chooseOkOnNextConfirmation"
12671269
|| command == "chooseCancelOnNextConfirmation"
12681270
|| command == "assertConfirmation"
1269-
|| command == "assertAlert")
1271+
|| command == "assertAlert"
1272+
|| command == "verifyAlert")
12701273
return true;
12711274
return false;
12721275
}

panel/js/katalon/kar-extra.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
var _gaq = _gaq || [];
2+
_gaq.push(['_setAccount', 'UA-183240578-1']);
3+
_gaq.push(['_trackPageview']);
4+
5+
(function() {
6+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
7+
ga.src = 'https://ssl.google-analytics.com/ga.js';
8+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
9+
})();
10+
11+
$(document).on('click', 'button,a,select,input,i', function() {
12+
var element = $(this);
13+
var id = element.attr('id');
14+
if (!id) {
15+
var parent = element.closest("[id]");
16+
if (parent) {
17+
id = parent.attr('id');
18+
if (!id) {
19+
id = element.text();
20+
}
21+
}
22+
}
23+
var value;
24+
if (element.is('select')) {
25+
value = element.val();
26+
} else {
27+
value = 'clicked';
28+
}
29+
_gaq.push(['_trackEvent', id, value]);
30+
});

panel/js/katalon/kar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ $(function() {
12371237
});
12381238
}
12391239

1240-
$('#ka-upload').on('click', function() {
1240+
$(document).on('click', '#ka-upload,#ka-upload-log', function() {
12411241
getProjects()
12421242
.then(projects => {
12431243
var select = $('#select-ka-project');

0 commit comments

Comments
 (0)