Skip to content

Commit

Permalink
fix and try countly removal (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
turtledreams committed Dec 5, 2023
1 parent 55fc1d4 commit 95de72c
Show file tree
Hide file tree
Showing 54 changed files with 77 additions and 74 deletions.
2 changes: 1 addition & 1 deletion cypress/fixtures/click_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
var domEl = queryExtractor(window.location.search).dom;
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
debug: true,
test_mode: true
})
Expand Down
8 changes: 4 additions & 4 deletions cypress/fixtures/multi_instance.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//initializing first instance, which will be global Countly
Countly.init({
app_key: "YOUR_APP_KEY1",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true
})
Countly.remove_consent();
Expand Down Expand Up @@ -57,7 +57,7 @@
//initialize second instance for another app synchronously
var Countly2 = Countly.init({
app_key: "YOUR_APP_KEY2", //must have different APP key
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true

});
Expand Down Expand Up @@ -94,7 +94,7 @@
//initialize third instance for another app asynchronously
Countly.q.push(["init", {
app_key: "YOUR_APP_KEY3", //must have different APP key
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true

}])
Expand Down Expand Up @@ -128,7 +128,7 @@
//initialize fourth instance for another app asynchronously
Countly.q.push(["init", {
app_key: "YOUR_APP_KEY4", //must have different APP key
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true

}])
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/referrer.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script type='text/javascript'>
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
utm: { aa: true },
test_mode: true,
test_mode_eq: true,
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/scroll_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
console.error("cleared the storage");
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
debug:true,
test_mode: true
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/scroll_test_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script type='text/javascript'>
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
debug:true,
test_mode: true
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/scroll_test_3.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
console.error("cleared the storage");
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
debug:true,
test_mode: true
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/session_test_auto.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//initializing countly with params
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
device_id: "auto",
session_update: 5,
test_mode: true,
Expand Down
4 changes: 2 additions & 2 deletions cypress/fixtures/session_test_manual_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//initializing countly with params
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
device_id: "manual_1",
session_update: 5,
test_mode: true,
Expand All @@ -47,7 +47,7 @@
Countly.begin_session();
}
function end(){
Countly.end_session();
Countly.end_session(undefined, true);
}
</script>
<button type="button" onclick="clickEvent()">Event</button>
Expand Down
4 changes: 2 additions & 2 deletions cypress/fixtures/session_test_manual_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//initializing countly with params
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
device_id: "manual_2",
session_update: 5,
test_mode: true,
Expand All @@ -34,7 +34,7 @@
Countly.begin_session();
// event listener to end session
window.addEventListener("beforeunload", function () {
Countly.end_session();
Countly.end_session(undefined, true);
})
</script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/user_agent.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
debug:true
})
// create a new button element and assign values of user agent functions to them here:
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/consents.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var hp = require("../support/helper");
function initMain(consent) {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
require_consent: consent,
device_id: "György Ligeti",
test_mode: true,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/crashes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hp = require("../support/helper");
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true
});
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/device_id.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hp = require("../support/helper");
function initMain(deviceId, offline, searchQuery, clear, rq, eq) {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
device_id: deviceId,
test_mode: rq,
test_mode_eq: eq,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/device_id_change.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var hp = require("../support/helper");
function initMain(offline) {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true,
debug: true,
offline_mode: offline
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/device_id_init_scenarios.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var hp = require("../support/helper");
function initMain(deviceId, offline, searchQuery, clear) {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
device_id: deviceId,
test_mode: true,
debug: true,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var hp = require("../support/helper");
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
session_update: 3,
test_mode: true,
test_mode_eq: true,
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/health_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hp = require("../support/helper");
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true
});
}
Expand All @@ -14,7 +14,7 @@ describe("Health Check tests ", () => {
it("Check if health check is sent at the beginning", () => {
hp.haltAndClearStorage(() => {
initMain();
cy.intercept("GET", "https://try.count.ly/i?**").as("getXhr");
cy.intercept("https://your.domain.count.ly/i?*").as("getXhr");
cy.wait("@getXhr").then((xhr) => {
const url = new URL(xhr.request.url);

Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var hp = require("../support/helper");
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
debug: true,
test_mode: true
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/internal_limits.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const limits = {
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode_eq: true,
test_mode: true,
debug: true,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/manual_widget_reporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function common_rating_check(param, num) {
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode_eq: true,
test_mode: true,
debug: true
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/remaining_requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hp = require("../support/helper");
function initMain(shouldStopRequests) {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
app_version: "1.0",
// would prevent requests from being sent to the server if true
test_mode: shouldStopRequests
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/reponse_validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var hp = require("../support/helper");
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true,
test_mode_eq: true,
debug: true
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const eventObj = {
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
session_update: 3,
test_mode: true
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hp = require("../support/helper");
function initMain(val) {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode_eq: true,
test_mode: true,
debug: true,
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/storage_change.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { triggerStorageChange } from "../support/integration_helper";
function initMain(val) {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
device_id: 0, // provide number
test_mode_eq: true,
test_mode: true,
Expand Down Expand Up @@ -78,7 +78,7 @@ describe("Multi tab storage change test", () => {
hp.haltAndClearStorage(() => {
let firstIns = Countly.init({
app_key: "YOUR_APP_KEY1",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
device_id: 0,
test_mode_eq: true,
test_mode: true,
Expand All @@ -87,7 +87,7 @@ describe("Multi tab storage change test", () => {
});
let secondIns = Countly.init({
app_key: "YOUR_APP_KEY2",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
device_id: -1,
test_mode_eq: true,
test_mode: true,
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/user_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var hp = require("../support/helper");
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode_eq: true
});
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/user_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var hp = require("../support/helper");
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode_eq: true,
test_mode: true
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/utm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hp = require("../support/helper");
function initMulti(appKey, searchQuery, utmStuff) {
Countly.init({
app_key: appKey,
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true,
test_mode_eq: true,
utm: utmStuff,
Expand Down
8 changes: 4 additions & 4 deletions cypress/integration/view_utm_referrer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hp = require("../support/helper");
function init(appKey, searchQuery, utmStuff) {
Countly.init({
app_key: appKey,
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true,
test_mode_eq: true,
utm: utmStuff, // utm object provided in init
Expand Down Expand Up @@ -166,7 +166,7 @@ describe("View with utm and referrer tests ", () => {
// default (original) init with no custom tags and default query
var C1 = Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true,
test_mode_eq: true,
utm: undefined, // utm object provided in init
Expand All @@ -179,7 +179,7 @@ describe("View with utm and referrer tests ", () => {
// utm object provided with appropriate query
var C2 = Countly.init({
app_key: "Countly_2",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode: true,
test_mode_eq: true,
utm: { ss: true }, // utm object provided in init
Expand Down Expand Up @@ -278,7 +278,7 @@ describe("isReferrerUsable tests", () => {
hp.haltAndClearStorage(() => {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
ignore_referrers: ["http://example.com"]
});
const result = Countly._internals.isReferrerUsable("http://example.com/something");
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var hp = require("../support/helper");
function initMain() {
Countly.init({
app_key: "YOUR_APP_KEY",
url: "https://try.count.ly",
url: "https://your.domain.count.ly",
test_mode_eq: true,
test_mode: true
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/web_worker_requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ describe("Web Worker Request Intercepting Tests", () => {
cy.intercept("GET", "**/i?**", (req) => {
const { url } = req;

// check url starts with https://try.count.ly/i?
assert.isTrue(url.startsWith("https://try.count.ly/i?"));
// check url starts with https://your.domain.count.ly/i?
assert.isTrue(url.startsWith("https://your.domain.count.ly/i?"));

// turn query string into object
const paramsObject = turnSearchStringToObject(url.split("?")[1]);
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ var waitFunction = function(startTime, waitTime, waitIncrement, continueCallback
/**
* This intercepts the request the SDK makes and returns the request parameters to the callback function
* @param {String} requestType - GET, POST, PUT, DELETE
* @param {String} requestUrl - request url (https://try.count.ly)
* @param {String} requestUrl - request url (https://your.domain.count.ly)
* @param {String} endPoint - endpoint (/i)
* @param {String} requestParams - request parameters (?begin_session=**)
* @param {String} alias - alias for the request
* @param {Function} callback - callback function
*/
function interceptAndCheckRequests(requestType, requestUrl, endPoint, requestParams, alias, callback) {
requestType = requestType || "GET";
requestUrl = requestUrl || "https://try.count.ly"; // TODO: might be needed in the future but not yet
requestUrl = requestUrl || "https://your.domain.count.ly"; // TODO: might be needed in the future but not yet
endPoint = endPoint || "/i";
requestParams = requestParams || "?**";
alias = alias || "getXhr";
Expand Down
Loading

0 comments on commit 95de72c

Please sign in to comment.