How to use the intern.default.getInterface function in intern

To help you get started, we’ve selected a few intern examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webcompat / webcompat.com / tests / functional / issue-list-non-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");

var url = function(path, params) {
  var base = intern.config.siteRoot + path;
  return params ? base + params : base;
};

registerSuite("Issue-list", {
  tests: {
    "FilterView renders"() {
      return FunctionalHelpers.openPage(
        this,
        url("/issues"),
        ".js-SearchIssue-filter"
      )
        .findAllByCssSelector(".js-Tag")
github webcompat / webcompat.com / tests / functional / comments-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");

var url = path => intern.config.siteRoot + path;

registerSuite("Comments (auth)", {
  before() {
    return FunctionalHelpers.login(this);
  },

  after() {
    return FunctionalHelpers.logout(this);
  },

  tests: {
    "Comments form visible when logged in"() {
      return (
github webcompat / webcompat.com / tests / functional / milestones-non-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");

var url = function(path) {
  return intern.config.siteRoot + path;
};

registerSuite("Milestones (non-auth)", {
  tests: {
    "Page loads without milestone set": function() {
      return FunctionalHelpers.openPage(
        this,
        url("/issues/9"),
        ".js-Issue",
        true /* longerTimeout */
      )
        .findByCssSelector(".js-issue-title")
github webcompat / webcompat.com / tests / functional / reporting-non-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");
const path = require("path");

var cwd = intern.config.basePath;
var VALID_IMAGE_PATH = path.join(cwd, "tests/fixtures", "green_square.png");
// DETAILS_STRING is a URL encoded object, stringified to JSON.
var DETAILS_STRING =
  '{"gfx.webrender.all"%3Afalse%2C"gfx.webrender.blob-images"%3A2%2C"gfx.webrender.enabled"%3Afalse%2C"image.mem.shared"%3A2%2C"layout.css.servo.enabled"%3Atrue}';

var url = function(path) {
  return intern.config.siteRoot + path;
};

registerSuite("Reporting (non-auth)", {
  tests: {
    "Submit buttons are disabled"() {
github webcompat / webcompat.com / tests / functional / issues-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");

var url = function(path) {
  return intern.config.siteRoot + path;
};

registerSuite("Issues (auth)", {
  before() {
    return FunctionalHelpers.login(this);
  },

  after() {
    return FunctionalHelpers.logout(this);
  },

  tests: {
github webcompat / webcompat.com / tests / functional / index-non-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");

var url = function(path) {
  return intern.config.siteRoot + path;
};

registerSuite("Index", {
  tests: {
    "front page loads"() {
      return FunctionalHelpers.openPage(this, url("/"), ".js-hero-title")
        .findByCssSelector(".js-hero-title")
        .getVisibleText()
        .then(function(text) {
          assert.equal(
            text.toLowerCase(),
            "Bug reporting\nfor the web.".toLowerCase()
github webcompat / webcompat.com / tests / functional / user-activity-non-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");

var url = function(path) {
  return intern.config.siteRoot + path;
};

registerSuite("User Activity (non-auth)", {
  tests: {
    "Trying to view someone else's activity fails (logged out)"() {
      return FunctionalHelpers.openPage(
        this,
        url("/activity/someoneelse"),
        "article"
      )
        .findByCssSelector("article .headline-1")
        .getVisibleText()
github webcompat / webcompat.com / tests / functional / milestones-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");

var url = function(path) {
  return intern.config.siteRoot + path;
};

registerSuite("Milestones (auth)", {
  before() {
    return FunctionalHelpers.login(this);
  },

  after() {
    return FunctionalHelpers.logout(this);
  },

  tests: {
github webcompat / webcompat.com / tests / functional / search-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");

var url = function(path, params) {
  var fullUrl =
    params !== undefined
      ? intern.config.siteRoot + path + params
      : intern.config.siteRoot + path;
  return fullUrl;
};

registerSuite("Search (auth)", {
  before() {
    return FunctionalHelpers.login(this);
  },

  after() {
github webcompat / webcompat.com / tests / functional / search-non-auth.js View on Github external
"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const intern = require("intern").default;
const { assert } = intern.getPlugin("chai");
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");

var url = function(path, params) {
  var base = intern.config.siteRoot + path;
  return params ? base + params : base;
};

registerSuite("Search (non-auth)", {
  tests: {
    "Pressing g inside of search input *doesnt* go to github issues"() {
      return (
        FunctionalHelpers.openPage(this, url("/issues"), "#js-SearchForm-input")
          .findByCssSelector("#js-SearchForm-input")
          .click()
          .type("g")
          .end()