小编Ole*_*hun的帖子

量角器E2E角度"角度无法在窗口找到"

在角度项目中运行我的测试后,我有一个奇怪的错误 Error: Error while waiting for Protractor to sync with the page: "angular could not be found on the window".我的Protractor配置如下所示:

require('coffee-script').register();

exports.config = {
  seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.39.0.jar',
  seleniumAddress: 'http://localhost:4444/wd/hub',

  capabilities: {
    browserName: 'chrome'
    //'chromeOptions': {
    //  'args': ['--disable-extensions']
    //}
  },

  specs: [
    '*_spec.coffee'
  ],

  allScriptsTimeout: 10000000000,
  baseUrl: 'http://localhost:9003/',

  jasmineNodeOpts: {
    isVerbose: false,
    showColors: true,
    includeStackTrace: true,
    defaultTimeoutInterval: 10000000000
  }
};
Run Code Online (Sandbox Code Playgroud)

并测试:

loginPage = require './pages/log_in_page'

describe 'Log In', ->

      it 'shows after login', ->
        loginPage()
        .setEmail('test@dispatch.me')
        .setPass('a46s75d4as765d4a6s7d54as76d5as74das76d5')
Run Code Online (Sandbox Code Playgroud)

从页面获取信息:

module.exports = …
Run Code Online (Sandbox Code Playgroud)

angularjs protractor e2e-testing

17
推荐指数
3
解决办法
3万
查看次数

QGraphicsItem仅通过X轴移动对象

我有一个问题只能通过x轴移动我的对象.我知道你需要有功能的东西QVariant itemChange ( GraphicsItemChange change, const QVariant & value ).我找到了这样的东西:

QVariant CircleItem::itemChange(GraphicsItemChange change, const QVariant &value)
{
    if (change == ItemPositionChange)
            return QPointF(pos().x(), value.toPointF().y());
    return QGraphicsItem::itemChange( change, value );
}
Run Code Online (Sandbox Code Playgroud)

但它不起作用.我是Qt的新手,所以我不知道,如何改变这个东西.这是我的GraphicsItem的代码:

#include "circleitem.h"

CircleItem::CircleItem()
{
    RectItem = new RoundRectItem();
    MousePressed = false;
    setFlag( ItemIsMovable );
}

void CircleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    if( MousePressed )
    {
        painter->setBrush( QBrush( QColor( 0, 0, 255 ) ) );
        painter->setPen( QPen( QColor( 0, 0, 255 ) ) );
    } …
Run Code Online (Sandbox Code Playgroud)

c++ qt

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

标签 统计

angularjs ×1

c++ ×1

e2e-testing ×1

protractor ×1

qt ×1