Tag: 量angular器

debuggingprotactor(有/没有webstorm)

所以我从量angular器开始,我想debugging我的testing代码: describe('stuff', function(){ it('should find the specs item, and its empty', function(){ browser.debugger(); gotoHome(); var allItems = element.all('li in model.tags'); var specsDashboardElement; for (var i=0 ; i < allItems.length; ++i) { var elem = allItems[i]; var text = elem.findElement(by.css('.li-title').getText()); // does this even work?? dunno if (text == "Specs") specsDashboardElement = elem; } expect(specsDashboardElement.isDisplayed()).toBe(true); }); […]

删除NG重复量angular器中的logging

所以我正在做量angular器和angular度的e2etesting, 我的第一个testing是在列表中添加一个元素, 现在我正试图删除它,而且我也遇到了麻烦 所以这是我需要做的: find我要删除的logging的名称 点击同一行的垃圾桶图标并将其删除 在出现的popup窗口上按确定 尽可能地避免使用By.css,并且更喜欢与angular度有关的所有东西(byBinding,model等)。 这是因为这部分应用程序最终会改变,因此我将不得不重做所有这些情况。 HTML: … <div class="list-group-item ng-scope" ng-repeat="item in teamList"> <span class="glyphicon glyphicon-user"></span> <span ng-bind="item.name" class="memberName ng-binding">nuevo Team</span> <a ng-click="editTeam(item._id)" class="hand-cursor"> <span class="glyphicon glyphicon-edit memberRemoveBotton"></span> </a> <a ng-confirm-click="Would you like to delete this item?" confirmed-click="deleteTeam(item._id)" class="hand-cursor"> <span class="glyphicon glyphicon-trash memberRemoveBotton"></span> </a> </div> JS: describe('Testing delete Item',function() { it('Should […]

如何说量angular器等到页面加载?

我的应用程序需要一些页面的login页面。所以量angular器尝试input用户名前加载页面。所以我需要说量angular器等待login页面加载。 你能帮我什么命令我需要使用这个和我需要使用?(请修改我的代码添加等待命令) PFB为我的onPrepare和beforeeachfunction onPrepare: function() { browser.driver.manage().window().maximize(); jasmine.getEnv().addReporter(new HtmlReporter({ }) } beforeEach(function() { browser.get('https://accounts.google.com/'); //browser.manage().timeouts().pageLoadTimeout(30000); //browser.manage().timeouts().implicitlyWait(5000); //browser.sleep( 10000 ); //browser.waitForAngular(); }); 我使用了那些注释的function,但是这对我没有任何作用。 请引导我。提前感谢。

如何使用Angular2路由

我试图写一个单页面的应用程序,但我不能让路由工作。 我尝试了很多教程,但是考虑到Angular2还处于testing阶段,他们似乎很快就过时了。 看来,只要我添加任何引用路由器指令或路由器configuration或路由器提供程序,应用程序停止工作,并在浏览器的控制台上打印以下错误: Error: Zone</ZoneDelegate</ZoneDelegate.prototype.invoke@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:332:20 Zone</Zone</Zone.prototype.run@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:227:25 scheduleResolveOrReject/<@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:576:53 Zone</ZoneDelegate</ZoneDelegate.prototype.invokeTask@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:365:24 Zone</Zone</Zone.prototype.runTask@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:263:29 drainMicroTaskQueue@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:482:26 ZoneTask/this.invoke@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:434:22 Evaluating http://localhost:3000/angular2/router Error loading http://localhost:3000/app/main.js 现在我有以下文件,这是行不通的: index.html <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Rapid</title> <!– 1. Load libraries –> <!– IE required polyfills, in this exact order –> <link href="css/dashboard.css" rel="stylesheet"> <link href="css/bootstrap.min.css" rel="stylesheet"> <script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/systemjs/dist/system-polyfills.js"></script> <script […]

npm开始 – 使用CORS

我正在使用Angular2开发一个小应用程序。 在5分钟内。 快速入门指南 npm用于安装所需的模块并启动lite-server。 后来我想在普通的networking服务器中使用这个应用程序,并用cordova构build移动应用程序。 如何,我正在使用REST api来加载一些数据。 如何configurationlite-server来解决CORS pre-flight选项检查? 我的apache服务器(在专用服务器上)已经configuration好了,但是我不想提交,更新和重新编译每一个小的改动。 我需要一个相应的configuration: Header always set Access-Control-Allow-Origin "https://my-domain.net:12345" Header always set Access-Control-Allow-Headers "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding" Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" Header always set Access-Control-Max-Age "1000"

量angular器:正确使用我的testing中的waitReady.js文件

我们在整个testing套件中广泛使用browser.wait。 pipe理不同场景的不同超时时,它变得头痛。 我遇到了一个waitReady函数( https://gist.github.com/elgalu/2939aad2b2e31418c1bb ),但我无法在我的代码中使用它。 该目录看起来像:(所有文件除了彼此)。 ├── conf.js ├── main.js ├── waitReady.js Main.js —>包含所有的描述和它的块 require('./waitReady.js'); describe(…){ it{ code… expect(element.waitReady()).toBeTruthy(); }; }); 出于某种原因,代码没有find该函数,我的代码不断收到函数未定义的错误。 我需要在什么地方初始化它吗?

Docker容器与Angular2应用程序和NodeJs不响应

我通过angular-cli创build了新的Angular2应用程序,并在Docker中运行它。 但我不能从本地连接它。 起初,我在本地机器上启动应用程序: ng new project && cd project && "put my Dockerfile there" && docker build -t my-ui . 我通过命令启动它: docker run -p 4200:4200 my-ui 然后尝试我的本地主机: curl localhost:4200 并接收 curl:(56)Recv失败:连接被同级重置 然后,我试着切换到运行容器( docker exec -ti container-id bash )并运行curl localhost:4200并且它可以工作。 我也试着用–net = host param运行容器: docker run –net=host -p 4200:4200 my-ui 它工作。 问题是什么? 我也尝试在守护进程模式下运行容器,并没有帮助。 谢谢。 我的Dockerfile FROM […]

生成:找不到“节点”的types定义文件

VS 2015社区版(在家里),npm 3.10,Angular 2我试图在ASP.Net MVC 5应用程序中获取Angular2设置。 我开始使用Angular的旧版本的模板,所以我更新了包引用。 当我构build时,列表中的第一个错误是: 生成:找不到“节点”的types定义文件 之后有几十个其他的错误,但我假设大部分是由于这第一个问题。 这里是package.json和typings.json 的package.json { "version": "1.0.0", "name": "aspnet", "private": true, "scripts": { "postinstall": "typings install", "typings": "typings" }, "dependencies": { "@angular/common": "~4.0.0", "@angular/compiler": "~4.0.0", "@angular/core": "~4.0.0", "@angular/forms": "~4.0.0", "@angular/http": "~4.0.0", "@angular/platform-browser": "~4.0.0", "@angular/platform-browser-dynamic": "~4.0.0", "@angular/router": "~4.0.0", "angular-in-memory-web-api": "~0.3.0", "systemjs": "0.19.40", "core-js": "^2.4.1", "rxjs": "5.0.1", "zone.js": "^0.8.4", […]

我怎么做一个Ctrl +点击量angular器?

我尝试了以下奇怪的组合,但他们都没有工作: var ptor = protractor.getInstance(); ptor.actions().mouseMove(node).keyDown(ptor.Key.CTRL).sendKeys(ptor.Key.CLICK).perform();

无法卸载angular-cli

我试了几次卸载我的angular度cli为了更新,但即使我按照github上提供的说明: npm uninstall -g @ angular / cli npmcaching清理 npm install -g @ angular / cli @ latest 当我检查使用命令ng –version我仍然得到旧版本: angular-cli: 1.0.0-beta.26 node: 7.7.1 os: darwin x64 我如何解决这个问题? 谢谢