Тестовый пакет Protractor e2e для загрузки CSV-файла без запроса - PullRequest
0 голосов
/ 03 сентября 2018

Транспортир e2e контрольный пример для загрузки файла csv без запроса не работает со следующим кодом. Пожалуйста помоги мне с этим. Я прошел через все, что уже доступно в stackoverflow. У меня ничего не получалось ...

var q = require("q");
var FirefoxProfile = require("firefox-profile");

var makeFirefoxProfile = function(preferenceMap, specs) {
    var deferred = q.defer();
    var firefoxProfile = new FirefoxProfile();

    for (var key in preferenceMap) {
        firefoxProfile.setPreference(key, preferenceMap[key]);
    }


    firefoxProfile.encoded(function (encodedProfile) {
        var capabilities = {
            browserName: "firefox",
            acceptInsecureCerts: true,
            "moz:webdriverClick": false,
            firefox_profile: encodedProfile,
        };

        deferred.resolve(capabilities);
    });
    return deferred.promise;
};


exports.config = {
  getMultiCapabilities: function() {
        return q.all([
            makeFirefoxProfile(
                {
                    "browser.download.dir": "./",
                    "browser.helperApps.neverAsk.saveToDisk": "text/commaseparated-values, text/csv, application/csv, application/excel, application/vnd.ms-excel, application/vnd.msexcel, text/anytext"
            },
        )
    ]);
},



  // NOTE: this will need changing if a new version of selenium
  // standalone server is released --->
  seleniumServerJar: 'node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.0.jar',

  specs: [
    'test/e2e/app.e2e_spec.js',
    'test/e2e/**/*.e2e_spec.js',
  ],

  capabilities: {
    browserName: 'firefox',
    acceptInsecureCerts: true,
    firefox_profile: makeFirefoxProfile,
    "moz:webdriverClick": false
  },


  jasmineNodeOpts: {
    defaultTimeoutInterval: 240000
  },

  baseUrl: 'https://localhost:3030/',

  seleniumAddress: 'http://localhost:4444/wd/hub',

  framework: 'jasmine'
};

С учетом вышесказанного мой protractor.conf файл не работает, для загрузки файла появляется всплывающее окно с подсказкой.

У вас есть идеи? Спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...