File: cypress/integration/integration.js

Recommend this page to a friend!
  Classes of Arturs Sosins   Countly Web SDK   cypress/integration/integration.js   Download  
File: cypress/integration/integration.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Countly Web SDK
Track site accesses and errors the Countly API
Author: By
Last change: New bundle (#456)

* new bundle

* read

* is

* reordered countly

* count.ly to countly

* re order features

* seperated elses

* function gap

* linter

* reverse linter

* gap

* more

* increased test robustness

* reminified

* removed mapping

* Update CHANGELOG.md

---------

Co-authored-by: Artūrs Kadiķis <kadikis.arturs@gmail.com>
fix and try countly removal (#455)
Date: 4 months ago
Size: 2,194 bytes
 

Contents

Class file image Download
var Countly = require("../../lib/countly"); var hp = require("../support/helper"); /** * init countly */ function initMain() { Countly.init({ app_key: "YOUR_APP_KEY", url: "https://your.domain.countly", debug: true, test_mode: true }); } describe("Integration test", () => { it("int, no consent, no offline_mode", () => { initMain(); const idType = Countly.get_device_id_type(); const id = Countly.get_device_id(); const consentStatus = Countly.check_any_consent(); Countly.remove_consent(); Countly.disable_offline_mode(); Countly.add_event({ key: "test", count: 1, sum: 1, dur: 1, segmentation: { test: "test" } }); Countly.start_event("test"); Countly.cancel_event("gobbledygook"); Countly.end_event("test"); Countly.report_conversion("camp_id", "camp_user_id"); Countly.recordDirectAttribution("camp_id", "camp_user_id"); Countly.user_details({ name: "name" }); Countly.userData.set("set", "set"); Countly.userData.save(); Countly.report_trace({ name: "name", stz: 1, type: "type" }); Countly.log_error({ error: "error", stack: "stack" }); Countly.add_log("error"); Countly.fetch_remote_config(); Countly.enrollUserToAb(); const remote = Countly.get_remote_config(); Countly.track_sessions(); Countly.track_pageview(); Countly.track_errors(); Countly.track_clicks(); Countly.track_scrolls(); Countly.track_links(); Countly.track_forms(); Countly.collect_from_forms(); Countly.collect_from_facebook(); Countly.opt_in(); // TODO: widgets // TODO: make better cy.fetch_local_request_queue().then((rq) => { cy.log(rq); hp.testNormalFlow(rq, "/__cypress/iframes/integration%2Fintegration.js", hp.appKey); expect(consentStatus).to.equal(true); // no consent necessary expect(remote).to.eql({}); // deepEqual expect(rq[0].device_id).to.equal(id); expect(rq[0].t).to.equal(idType); }); }); });