小编pel*_*can的帖子

Nginx服务未在Windows 10上启动-nginx:[警报]无法打开错误日志文件:CreateFile()

我有一个配置为在Windows 10上自动启动的Nginx服务;但是,今天早上,该服务无法启动。错误日志显示:nginx:[alert] could not open error log file: CreateFile() "C:\someForlderName\build\distribution\.\nginx/logs/error.log" failed (3: The system cannot find the path specified)

查看上面错误日志中的路径,我的本地系统上没有/ logs /文件夹,因此看来Nginx没有创建该文件夹的适当权限?

我设置为管理员用户,我的服务设置为“ 登录身份-本地系统帐户”

仅在Windows 10上会发生这种情况。但该服务会启动并在较旧的Windows(即8.1)上运行

那么,有谁知道如何向Nginx授予管理员权限,以便Nginx可以在Windows 10上创建文件夹和文件?

file-permissions nginx windows-10

4
推荐指数
2
解决办法
1万
查看次数

维护并重用现有的webdriver浏览器实例 - java

基本上每次我从eclipse运行我的java代码时,webdriver都会启动一个新的ie浏览器并在大多数情况下成功执行我的测试.但是,我有很多测试要运行,webdriver每次启动一个新的浏览器会话都很痛苦.我需要一种方法来重用以前打开的浏览器; 所以webdriver会打开,即第一次,然后第二次,我运行我的eclipse程序,我希望它只是拿起以前的浏览器实例并继续在同一个实例上运行我的测试.这样,我每次运行程序时都不会启动新的浏览器会话.

假设您有100个测试要在eclipse中运行,您点击该运行按钮并且它们都运行,然后在大约第87次测试时您会收到错误.然后你回到eclipse,修复那个错误,但是你必须从头再次重新运行所有100个测试.

在第87次测试中修复错误然后从第87次测试恢复执行,而不是从头开始重新执行所有测试,即从测试0一直到100,这将是很好的.希望,我很清楚你们的帮助,谢谢顺便说一下.

以下是我尝试维护和重新使用webdriver Internet Explorer浏览器实例的尝试:

public class demo extends RemoteWebDriver { 

    public static WebDriver driver;
    public Selenium selenium;
    public WebDriverWait wait;
    public String propertyFile;
    String getSessionId;


    public demo() { // constructor


        DesiredCapabilities ieCapabilities = DesiredCapabilities
                .internetExplorer();
        ieCapabilities
                .setCapability(
                        InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
                        true);
        driver = new InternetExplorerDriver(ieCapabilities);


        this.saveSessionIdToSomeStorage(getSessionId);
        this.startSession(ieCapabilities);
        driver.manage().window().maximize();
    }

    @Override
      protected void startSession(Capabilities desiredCapabilities) {
        String sid = getPreviousSessionIdFromSomeStorage();
        if (sid != null) {
          setSessionId(sid);
          try {
            getCurrentUrl();
          } catch (WebDriverException e) {
            // session is not valid
            sid …
Run Code Online (Sandbox Code Playgroud)

java selenium browser-automation selenium-webdriver remotewebdriver

1
推荐指数
1
解决办法
2万
查看次数

打破了量角器.filter()或.map()循环

我正在使用量角器和黄瓜框架; 如何突破.filter或.map循环?如果我发现匹配,我不想再继续迭代!

Page.prototype.getElementByKey = function (key) {
      var foundElement = null;
      return someElement.all(by.css('.someClass')).map(function (rawItem, index) {
        var itemObject = new ItemObjectClass(rawItem);
        return itemObject.getItemKey().then(function (foundItemKey) {
          var matched = String(foundItemKey).trim() === String(key).trim();

         console.log(' Matched: { ' + matched + ' }  index {'+index+'}');
          //if we have a match break out of the .filter function
          if (matched) {
            foundElement = itemObject;
            throw new Error("Just our way of breaking out of .filter() above");
          }
        });
      }).then(function () {
        //callback
        throw new Error('\n!!!!!Callback should …
Run Code Online (Sandbox Code Playgroud)

selenium browser-automation webautomation protractor e2e-testing

1
推荐指数
1
解决办法
2843
查看次数

录制量角器e2e测试的视频

我使用量角器和gulp测试角度应用程序。

我正在寻找一种方法,record videos for my Protractor e2e tests以便可以将它们播放为.mp4或可以在Windows 10上打开的任何其他形式。

有没有人做到这一点?您能否建议一些有用的链接或代码?

selenium protractor e2e-testing

1
推荐指数
2
解决办法
2752
查看次数

docker-compose drupal 不接受我的数据库名称并在下面抛出错误

我有以下docker-compose.yml文件:

version: '3'

services:
  maria_service:
    build: ./db_maria
    restart: always
    environment:
      MYSQL_DATABASE: mariadb
      MYSQL_USER: joel
      MYSQL_PASSWORD: password
      MYSQL_ROOT_PASSWORD: password
    volumes:
      - ./db:/var/lib/mysql

  drupal_service:
    build: ./website
    restart: always
    ports:
      - 8080:80
    volumes:
      - /var/www/html/modules
      - /var/www/html/profiles
      - /var/www/html/themes
      # this takes advantage of the feature in Docker that a new anonymous
      # volume (which is what we're creating here) will be initialized with the
      # existing content of the image at the same location
      - /var/www/html/sites
    depends_on:
      - maria_service
Run Code Online (Sandbox Code Playgroud)

这是我的工作目录: …

drupal docker dockerfile docker-compose

0
推荐指数
1
解决办法
760
查看次数

导入错误:没有模块 django_nose

我遵循这个复数课程,每次运行命令时都会遇到这个错误:

python manage.py test --settings=todobackend.settings.test
Run Code Online (Sandbox Code Playgroud)

我是 Django 框架的新手;问题可能是我的 django 版本(1.9.0)只支持 python 3.x 而不是 2.x?

python --version
Python 2.7.13
Run Code Online (Sandbox Code Playgroud)

点击图片查看更大、更清晰的图像。

在此处输入图片说明

在此处输入图片说明

python django python-2.7 python-3.x django-nose

0
推荐指数
1
解决办法
2016
查看次数

在docker容器中运行时,nodejs app不会连接到localhost

My environment:
Ubunut 17.04 LTS
npm --version: 5.6.0
nodejs --version: 4.7.2
angular cli version: 1.6.4
Run Code Online (Sandbox Code Playgroud)

docker-compose文件:

version: '3'

services:
 my-app:
    build:
      context: .
      dockerfile: Dockerfile
    restart: unless-stopped
    volumes:
      - .:/usr/src/app
    ports:
      - "4200:4200"
Run Code Online (Sandbox Code Playgroud)

我在dockerfile中注释掉了EXPOSE 4200,因为我已经从docker-compose.yml文件中安装了它,是不是没问题,我应该在dockerfile中公开并在docker-compose中挂载?

在命令行上运行npm start会在浏览器上成功启动应用程序,因为我可以去localhost:4200看看应用程序是否正在运行.

但是,如果我使用docker构建我的应用程序并运行docker-compose,我看到nodejs服务器仍在运行localhost:4200,但是,我无法访问该应用程序,因此localhost:4200无法启动该页面.

运行APP手动工作很棒,我可以在浏览器上看到它:

ubuntu17@ubuntu17:~/playground/apps/myapp-ui$ ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Date: 2018-01-16T16:22:51.912Z                                                          
Hash: 40ac2bd0588ee2136d15
Time: 13963ms
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]
chunk {main} main.bundle.js …
Run Code Online (Sandbox Code Playgroud)

docker dockerfile docker-compose docker-swarm docker-machine

0
推荐指数
1
解决办法
2473
查看次数