在角度项目中运行我的测试后,我有一个奇怪的错误 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) 我有一个问题只能通过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)