How to use stopped method in qawolf

Best JavaScript code snippet using qawolf

animationqueue_test.js

Source:animationqueue_test.js Github

copy

Full Screen

1// Copyright 2011 The Closure Library Authors. All Rights Reserved.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS-IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14goog.provide('goog.fx.AnimationQueueTest');15goog.setTestOnly('goog.fx.AnimationQueueTest');16goog.require('goog.events');17goog.require('goog.fx.Animation');18goog.require('goog.fx.AnimationParallelQueue');19goog.require('goog.fx.AnimationSerialQueue');20goog.require('goog.fx.Transition');21goog.require('goog.fx.anim');22goog.require('goog.testing.MockClock');23goog.require('goog.testing.jsunit');24var clock;25function setUpPage() {26 clock = new goog.testing.MockClock(true);27 goog.fx.anim.setAnimationWindow(null);28}29function tearDownPage() {30 clock.dispose();31}32function testParallelEvents() {33 var anim = new goog.fx.AnimationParallelQueue();34 anim.add(new goog.fx.Animation([0], [100], 200));35 anim.add(new goog.fx.Animation([0], [100], 400));36 anim.add(new goog.fx.Animation([0], [100], 600));37 assertTrue(anim.queue[0].isStopped());38 assertTrue(anim.queue[1].isStopped());39 assertTrue(anim.queue[2].isStopped());40 assertTrue(anim.isStopped());41 var playEvents = 0, beginEvents = 0, resumeEvents = 0, pauseEvents = 0;42 var endEvents = 0, stopEvents = 0, finishEvents = 0;43 goog.events.listen(anim, goog.fx.Transition.EventType.PLAY, function() {44 ++playEvents; });45 goog.events.listen(anim, goog.fx.Transition.EventType.BEGIN, function() {46 ++beginEvents; });47 goog.events.listen(anim, goog.fx.Transition.EventType.RESUME, function() {48 ++resumeEvents; });49 goog.events.listen(anim, goog.fx.Transition.EventType.PAUSE, function() {50 ++pauseEvents; });51 goog.events.listen(anim, goog.fx.Transition.EventType.END, function() {52 ++endEvents; });53 goog.events.listen(anim, goog.fx.Transition.EventType.STOP, function() {54 ++stopEvents; });55 goog.events.listen(anim, goog.fx.Transition.EventType.FINISH, function() {56 ++finishEvents; });57 // PLAY, BEGIN58 anim.play();59 // No queue events.60 clock.tick(100);61 // PAUSE62 anim.pause();63 // No queue events64 clock.tick(200);65 // PLAY, RESUME66 anim.play();67 // No queue events.68 clock.tick(400);69 // END, STOP70 anim.stop();71 // PLAY, BEGIN72 anim.play();73 // No queue events.74 clock.tick(400);75 // END, FINISH76 clock.tick(200);77 // Make sure the event counts are right.78 assertEquals(3, playEvents);79 assertEquals(2, beginEvents);80 assertEquals(1, resumeEvents);81 assertEquals(1, pauseEvents);82 assertEquals(2, endEvents);83 assertEquals(1, stopEvents);84 assertEquals(1, finishEvents);85}86function testSerialEvents() {87 var anim = new goog.fx.AnimationSerialQueue();88 anim.add(new goog.fx.Animation([0], [100], 100));89 anim.add(new goog.fx.Animation([0], [100], 200));90 anim.add(new goog.fx.Animation([0], [100], 300));91 assertTrue(anim.queue[0].isStopped());92 assertTrue(anim.queue[1].isStopped());93 assertTrue(anim.queue[2].isStopped());94 assertTrue(anim.isStopped());95 var playEvents = 0, beginEvents = 0, resumeEvents = 0, pauseEvents = 0;96 var endEvents = 0, stopEvents = 0, finishEvents = 0;97 goog.events.listen(anim, goog.fx.Transition.EventType.PLAY, function() {98 ++playEvents; });99 goog.events.listen(anim, goog.fx.Transition.EventType.BEGIN, function() {100 ++beginEvents; });101 goog.events.listen(anim, goog.fx.Transition.EventType.RESUME, function() {102 ++resumeEvents; });103 goog.events.listen(anim, goog.fx.Transition.EventType.PAUSE, function() {104 ++pauseEvents; });105 goog.events.listen(anim, goog.fx.Transition.EventType.END, function() {106 ++endEvents; });107 goog.events.listen(anim, goog.fx.Transition.EventType.STOP, function() {108 ++stopEvents; });109 goog.events.listen(anim, goog.fx.Transition.EventType.FINISH, function() {110 ++finishEvents; });111 // PLAY, BEGIN112 anim.play();113 // No queue events.114 clock.tick(100);115 // PAUSE116 anim.pause();117 // No queue events118 clock.tick(200);119 // PLAY, RESUME120 anim.play();121 // No queue events.122 clock.tick(400);123 // END, STOP124 anim.stop();125 // PLAY, BEGIN126 anim.play(true);127 // No queue events.128 clock.tick(400);129 // END, FINISH130 clock.tick(200);131 // Make sure the event counts are right.132 assertEquals(3, playEvents);133 assertEquals(2, beginEvents);134 assertEquals(1, resumeEvents);135 assertEquals(1, pauseEvents);136 assertEquals(2, endEvents);137 assertEquals(1, stopEvents);138 assertEquals(1, finishEvents);139}140function testParallelPause() {141 var anim = new goog.fx.AnimationParallelQueue();142 anim.add(new goog.fx.Animation([0], [100], 100));143 anim.add(new goog.fx.Animation([0], [100], 200));144 anim.add(new goog.fx.Animation([0], [100], 300));145 assertTrue(anim.queue[0].isStopped());146 assertTrue(anim.queue[1].isStopped());147 assertTrue(anim.queue[2].isStopped());148 assertTrue(anim.isStopped());149 anim.play();150 assertTrue(anim.queue[0].isPlaying());151 assertTrue(anim.queue[1].isPlaying());152 assertTrue(anim.queue[2].isPlaying());153 assertTrue(anim.isPlaying());154 clock.tick(100);155 assertTrue(anim.queue[0].isStopped());156 assertTrue(anim.queue[1].isPlaying());157 assertTrue(anim.queue[2].isPlaying());158 assertTrue(anim.isPlaying());159 anim.pause();160 assertTrue(anim.queue[0].isStopped());161 assertTrue(anim.queue[1].isPaused());162 assertTrue(anim.queue[2].isPaused());163 assertTrue(anim.isPaused());164 clock.tick(200);165 assertTrue(anim.queue[0].isStopped());166 assertTrue(anim.queue[1].isPaused());167 assertTrue(anim.queue[2].isPaused());168 assertTrue(anim.isPaused());169 anim.play();170 assertTrue(anim.queue[0].isStopped());171 assertTrue(anim.queue[1].isPlaying());172 assertTrue(anim.queue[2].isPlaying());173 assertTrue(anim.isPlaying());174 clock.tick(100);175 assertTrue(anim.queue[0].isStopped());176 assertTrue(anim.queue[1].isStopped());177 assertTrue(anim.queue[2].isPlaying());178 assertTrue(anim.isPlaying());179 anim.pause();180 assertTrue(anim.queue[0].isStopped());181 assertTrue(anim.queue[1].isStopped());182 assertTrue(anim.queue[2].isPaused());183 assertTrue(anim.isPaused());184 clock.tick(200);185 assertTrue(anim.queue[0].isStopped());186 assertTrue(anim.queue[1].isStopped());187 assertTrue(anim.queue[2].isPaused());188 assertTrue(anim.isPaused());189 anim.play();190 assertTrue(anim.queue[0].isStopped());191 assertTrue(anim.queue[1].isStopped());192 assertTrue(anim.queue[2].isPlaying());193 assertTrue(anim.isPlaying());194 clock.tick(100);195 assertTrue(anim.queue[0].isStopped());196 assertTrue(anim.queue[1].isStopped());197 assertTrue(anim.queue[2].isStopped());198 assertTrue(anim.isStopped());199}200function testSerialPause() {201 var anim = new goog.fx.AnimationSerialQueue();202 anim.add(new goog.fx.Animation([0], [100], 100));203 anim.add(new goog.fx.Animation([0], [100], 200));204 anim.add(new goog.fx.Animation([0], [100], 300));205 assertTrue(anim.queue[0].isStopped());206 assertTrue(anim.queue[1].isStopped());207 assertTrue(anim.queue[2].isStopped());208 assertTrue(anim.isStopped());209 anim.play();210 assertTrue(anim.queue[0].isPlaying());211 assertTrue(anim.queue[1].isStopped());212 assertTrue(anim.queue[2].isStopped());213 assertTrue(anim.isPlaying());214 clock.tick(100);215 assertTrue(anim.queue[0].isStopped());216 assertTrue(anim.queue[1].isPlaying());217 assertTrue(anim.queue[2].isStopped());218 assertTrue(anim.isPlaying());219 anim.pause();220 assertTrue(anim.queue[0].isStopped());221 assertTrue(anim.queue[1].isPaused());222 assertTrue(anim.queue[2].isStopped());223 assertTrue(anim.isPaused());224 clock.tick(400);225 assertTrue(anim.queue[0].isStopped());226 assertTrue(anim.queue[1].isPaused());227 assertTrue(anim.queue[2].isStopped());228 assertTrue(anim.isPaused());229 anim.play();230 assertTrue(anim.queue[0].isStopped());231 assertTrue(anim.queue[1].isPlaying());232 assertTrue(anim.queue[2].isStopped());233 assertTrue(anim.isPlaying());234 clock.tick(200);235 assertTrue(anim.queue[0].isStopped());236 assertTrue(anim.queue[1].isStopped());237 assertTrue(anim.queue[2].isPlaying());238 assertTrue(anim.isPlaying());239 anim.pause();240 assertTrue(anim.queue[0].isStopped());241 assertTrue(anim.queue[1].isStopped());242 assertTrue(anim.queue[2].isPaused());243 assertTrue(anim.isPaused());244 clock.tick(300);245 assertTrue(anim.queue[0].isStopped());246 assertTrue(anim.queue[1].isStopped());247 assertTrue(anim.queue[2].isPaused());248 assertTrue(anim.isPaused());249 anim.play();250 clock.tick(300);251 assertTrue(anim.queue[0].isStopped());252 assertTrue(anim.queue[1].isStopped());253 assertTrue(anim.queue[2].isStopped());254 assertTrue(anim.isStopped());...

Full Screen

Full Screen

sample.js

Source:sample.js Github

copy

Full Screen

1// Register a new language2monaco.languages.register({ id: 'mySpecialLanguage' });3// Register a tokens provider for the language4monaco.languages.setMonarchTokensProvider('mySpecialLanguage', {5 tokenizer: {6 root: [7 [/\[error.*/, "custom-error"],8 [/\[notice.*/, "custom-notice"],9 [/\[info.*/, "custom-info"],10 [/\[[a-zA-Z 0-9:]+\]/, "custom-date"],11 ]12 }13});14// Define a new theme that contains only rules that match this language15monaco.editor.defineTheme('myCoolTheme', {16 base: 'vs',17 inherit: false,18 rules: [19 { token: 'custom-info', foreground: '808080' },20 { token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' },21 { token: 'custom-notice', foreground: 'FFA500' },22 { token: 'custom-date', foreground: '008800' },23 ]24});25// Register a completion item provider for the new language26monaco.languages.registerCompletionItemProvider('mySpecialLanguage', {27 provideCompletionItems: () => {28 var suggestions = [{29 label: 'simpleText',30 kind: monaco.languages.CompletionItemKind.Text,31 insertText: 'simpleText'32 }, {33 label: 'testing',34 kind: monaco.languages.CompletionItemKind.Keyword,35 insertText: 'testing(${1:condition})',36 insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet37 }, {38 label: 'ifelse',39 kind: monaco.languages.CompletionItemKind.Snippet,40 insertText: [41 'if (${1:condition}) {',42 '\t$0',43 '} else {',44 '\t',45 '}'46 ].join('\n'),47 insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,48 documentation: 'If-Else Statement'49 }];50 return { suggestions: suggestions };51 }52});53monaco.editor.create(document.getElementById("container"), {54 theme: 'myCoolTheme',55 value: getCode(),56 language: 'mySpecialLanguage'57});58function getCode() {59 return [60 '[Sun Mar 7 16:02:00 2004] [notice] Apache/1.3.29 (Unix) configured -- resuming normal operations',61 '[Sun Mar 7 16:02:00 2004] [info] Server built: Feb 27 2004 13:56:37',62 '[Sun Mar 7 16:02:00 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)',63 '[Sun Mar 7 16:05:49 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',64 '[Sun Mar 7 16:45:56 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',65 '[Sun Mar 7 17:13:50 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',66 '[Sun Mar 7 17:21:44 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',67 '[Sun Mar 7 17:23:53 2004] statistics: Use of uninitialized value in concatenation (.) or string at /home/httpd/twiki/lib/TWiki.pm line 528.',68 '[Sun Mar 7 17:23:53 2004] statistics: Can\'t create file /home/httpd/twiki/data/Main/WebStatistics.txt - Permission denied',69 '[Sun Mar 7 17:27:37 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',70 '[Sun Mar 7 17:31:39 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',71 '[Sun Mar 7 17:58:00 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',72 '[Sun Mar 7 18:00:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',73 '[Sun Mar 7 18:10:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',74 '[Sun Mar 7 18:19:01 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',75 '[Sun Mar 7 18:42:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',76 '[Sun Mar 7 18:52:30 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',77 '[Sun Mar 7 18:58:52 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',78 '[Sun Mar 7 19:03:58 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',79 '[Sun Mar 7 19:08:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',80 '[Sun Mar 7 20:04:35 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',81 '[Sun Mar 7 20:11:33 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',82 '[Sun Mar 7 20:12:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',83 '[Sun Mar 7 20:25:31 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',84 '[Sun Mar 7 20:44:48 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',85 '[Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',86 '[Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome',87 '[Sun Mar 7 21:20:14 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',88 '[Sun Mar 7 21:31:12 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',89 '[Sun Mar 7 21:39:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',90 '[Sun Mar 7 21:44:10 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',91 '[Mon Mar 8 01:35:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',92 '[Mon Mar 8 01:47:06 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',93 '[Mon Mar 8 01:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',94 '[Mon Mar 8 02:12:24 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',95 '[Mon Mar 8 02:54:54 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',96 '[Mon Mar 8 03:46:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',97 '[Mon Mar 8 03:48:18 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',98 '[Mon Mar 8 03:52:17 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',99 '[Mon Mar 8 03:55:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',100 '[Mon Mar 8 04:22:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',101 '[Mon Mar 8 04:24:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',102 '[Mon Mar 8 04:40:32 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',103 '[Mon Mar 8 04:55:40 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',104 '[Mon Mar 8 04:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',105 '[Mon Mar 8 05:22:57 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',106 '[Mon Mar 8 05:24:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',107 '[Mon Mar 8 05:31:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',108 '<11>httpd[31628]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_inf.html in 29-Mar 15:18:20.50 from xx.xx.xx.xx',109 '<11>httpd[25859]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_bin/shtml.exe/_vti_rpc in 29-Mar 15:18:20.54 from xx.xx.xx.xx',110 ].join('\n');;...

Full Screen

Full Screen

Widget_capturesDock.py

Source:Widget_capturesDock.py Github

copy

Full Screen

1# -*- coding: utf-8 -*-2# vim: expandtab ts=4 sw=4 sts=4:3#4# Copyright (C) 2007-2010 GNS3 Development Team (http://www.gns3.net/team).5#6# This program is free software; you can redistribute it and/or modify7# it under the terms of the GNU General Public License version 2 as8# published by the Free Software Foundation;9#10# This program is distributed in the hope that it will be useful,11# but WITHOUT ANY WARRANTY; without even the implied warranty of12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13# GNU General Public License for more details.14#15# You should have received a copy of the GNU General Public License16# along with this program; if not, write to the Free Software17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA18#19# http://www.gns3.net/contact20#21import GNS3.Globals as globals22from PyQt4 import QtCore, QtGui23import GNS3.Dynagen.qemu_lib as qemu24import GNS3.Dynagen.dynagen_vbox_lib as vboxlib25from GNS3.Node.IOSRouter import IOSRouter26from GNS3.Utils import translate27class capturesDock(QtGui.QTreeWidget):28 """ Class for showing the captures29 Custom QTreeWidget30 """31 def __init__(self, parent):32 QtGui.QTreeWidget.__init__(self, parent)33 self.stoppedLinks = {}34 def refresh(self):35 """ Refresh topology summary36 """37 self.clear()38 refreshed_stoppedLinks = {}39 for link in globals.GApp.topology.links.copy():40 if link.capturing or self.stoppedLinks.has_key(link):41 42 if self.stoppedLinks.has_key(link):43 captureInfo = self.stoppedLinks[link]44 refreshed_stoppedLinks[link] = captureInfo45 else:46 captureInfo = link.captureInfo47 device = globals.GApp.dynagen.devices[captureInfo[0]]48 if isinstance(device, qemu.AnyEmuDevice):49 (hostname, port) = captureInfo50 port = 'e' + port51 elif isinstance(device, vboxlib.AnyVBoxEmuDevice):52 (hostname, port) = captureInfo53 port = 'e' + port54 else:55 (hostname, slot, inttype, port, encapsulation) = captureInfo56 if device.model_string in ['1710', '1720', '1721', '1750']:57 port = inttype + str(port)58 else:59 port = inttype + str(slot) + '/' + str(port)60 item = QtGui.QTreeWidgetItem(self)61 item.setData(0, QtCore.Qt.UserRole, QtCore.QVariant([hostname, port]))62 item.setText(0, hostname)63 if self.stoppedLinks.has_key(link) or (isinstance(device, IOSRouter) and device.state != 'running'):64 item.setIcon(0, QtGui.QIcon(':/icons/led_red.svg'))65 if link.capturing and not self.stoppedLinks.has_key(link):66 link.stopCapturing(showMessage=False, refresh=False)67 refreshed_stoppedLinks[link] = captureInfo68 elif device.state != 'running':69 item.setIcon(0, QtGui.QIcon(':/icons/led_red.svg'))70 else:71 item.setIcon(0, QtGui.QIcon(':/icons/led_green.svg'))72 item.setText(1, port)73 self.insertTopLevelItem(0, item)74 75 self.sortByColumn(0, QtCore.Qt.AscendingOrder)76 self.resizeColumnToContents(0)77 self.resizeColumnToContents(1)78 self.stoppedLinks = refreshed_stoppedLinks79 def mousePressEvent(self, event):80 if event.button() == QtCore.Qt.RightButton:81 self.showContextualMenu()82 else:83 QtGui.QTreeWidget.mousePressEvent(self, event)84 def showContextualMenu(self):85 menu = QtGui.QMenu()86 startAllCaptures = QtGui.QAction(translate('Widget_capturesDock', 'Start all captures'), menu)87 startAllCaptures.setIcon(QtGui.QIcon(":/icons/capture-start.svg"))88 self.connect(startAllCaptures, QtCore.SIGNAL('triggered()'), self.startAllCaptures)89 stopAllCaptures = QtGui.QAction(translate('Widget_capturesDock', 'Stop all captures'), menu)90 stopAllCaptures.setIcon(QtGui.QIcon(":/icons/capture-stop.svg"))91 self.connect(stopAllCaptures, QtCore.SIGNAL('triggered()'), self.stopAllCaptures)92 clearStoppedCaptures = QtGui.QAction(translate('Widget_capturesDock', 'Clear stopped captures'), menu)93 clearStoppedCaptures.setIcon(QtGui.QIcon(":/icons/edit-clear.svg"))94 self.connect(clearStoppedCaptures, QtCore.SIGNAL('triggered()'), self.clearStoppedCaptures)95 menu.addAction(startAllCaptures)96 menu.addAction(stopAllCaptures)97 menu.addAction(clearStoppedCaptures)98 curitem = self.currentItem()99 if curitem:100 menu.addSeparator()101 link = self.getLink()102 if self.stoppedLinks.has_key(link) or not link.capturing:103 startCapture = QtGui.QAction(translate('Widget_capturesDock', 'Start capturing'), menu)104 startCapture.setIcon(QtGui.QIcon(':/icons/capture-start.svg'))105 self.connect(startCapture, QtCore.SIGNAL('triggered()'), self.slotStartCapture)106 menu.addAction(startCapture)107 else:108 stopCapture = QtGui.QAction(translate('Widget_capturesDock', 'Stop capturing'), menu)109 stopCapture.setIcon(QtGui.QIcon(':/icons/capture-stop.svg'))110 self.connect(stopCapture, QtCore.SIGNAL('triggered()'), self.slotStopCapture)111 menu.addAction(stopCapture)112 startWireshark = QtGui.QAction(translate('Widget_capturesDock', 'Start Wireshark'), menu)113 startWireshark.setIcon(QtGui.QIcon(":/icons/wireshark.png"))114 self.connect(startWireshark, QtCore.SIGNAL('triggered()'), self.slotStartWireshark)115 menu.addAction(startWireshark)116 menu.exec_(QtGui.QCursor.pos())117 118 def getLink(self):119 120 item = self.currentItem()121 data = item.data(0, QtCore.Qt.UserRole).toStringList()122 hostname = unicode(data[0])123 interface = str(data[1])124 for link in globals.GApp.topology.links:125 if link.source.hostname == hostname and link.srcIf == interface:126 return link127 elif link.dest.hostname == hostname and link.destIf == interface:128 return link129 return None130 def clearStoppedCaptures(self):131 self.stoppedLinks = {}132 self.refresh()133 def stopAllCaptures(self):134 for link in globals.GApp.topology.links:135 if link.capturing:136 self.stoppedLinks[link] = link.captureInfo137 link.stopCapturing()138 self.refresh()139 def startAllCaptures(self):140 refreshed_stoppedLinks = {}141 for (link, captureInfo) in self.stoppedLinks.iteritems():142 self.startCapturing(link, captureInfo)143 if not link.capturing:144 refreshed_stoppedLinks[link] = captureInfo145 self.stoppedLinks = refreshed_stoppedLinks146 self.refresh()147 def slotStopCapture(self):148 link = self.getLink()149 # this should never happen150 assert(link)151 self.stoppedLinks[link] = link.captureInfo152 link.stopCapturing()153 #self.refresh()154 def startCapturing(self, link, captureInfo):155 156 device = globals.GApp.dynagen.devices[captureInfo[0]]157 encapsulation = None158 if isinstance(device, qemu.AnyEmuDevice):159 (hostname, port) = captureInfo160 port = 'e' + port161 elif isinstance(device, vboxlib.AnyVBoxEmuDevice):162 (hostname, port) = captureInfo163 port = 'e' + port164 else:165 (hostname, slot, inttype, port, encapsulation) = captureInfo166 if device.model_string in ['1710', '1720', '1721', '1750']:167 port = inttype + str(port)168 else:169 port = inttype + str(slot) + '/' + str(port)170 link.startCapturing(hostname, port, encapsulation)171 def slotStartCapture(self):172 link = self.getLink()173 # this should never happen174 assert(link)175 if self.stoppedLinks.has_key(link):176 captureInfo = self.stoppedLinks[link]177 del self.stoppedLinks[link]178 self.startCapturing(link, captureInfo)179 #self.refresh()180 def slotStartWireshark(self):181 link = self.getLink()182 # this should never happen183 assert(link)...

Full Screen

Full Screen

test_build.py

Source:test_build.py Github

copy

Full Screen

...49 assert build.get_status()[0]["exitcode"] == image.execute_file.return_value.returncode50 def test_output(self, build, image):51 build.execute_one_command()52 assert build.get_status()[0]["output"] == image.execute_file.return_value.stdout.decode.return_value53 def test_build_without_commands_is_stopped(self):54 build = Build(Mock(), [])55 assert build.get_status_code() == "stopped"56class TestExecution:57 def test_execute_calls_all_commands(self, build, commands):58 build.execute_one_command = Mock()59 build.execute()60 assert build.execute_one_command.call_count == len(commands)61 def test_status_code(self, build, image, commands):62 def test(*args):63 assert build.get_status_code() == "running"64 return Mock()65 image.execute_file.side_effect = test66 for _ in commands:67 assert build.get_status_code() == "waiting"...

Full Screen

Full Screen

simple_aeb.py

Source:simple_aeb.py Github

copy

Full Screen

1# -*- coding: utf-8 -*-2"""3Created on Wed Nov 13 11:24:37 20194@author: jonkro5"""6from tulip import spec, synth7import pickle8# %%9env_vars = {10 'goal': 'boolean',11 'safe_stopped': 'boolean',12 'emergency_stopped': 'boolean',13 'sensor_failure': 'boolean',14 'driving': 'boolean',15 'upp_2_response': ['none', 'success'],16 'sst_available': (0, 1),17}18env_init = {19 '!goal',20 '!safe_stopped',21 '!emergency_stopped',22 '!sensor_failure',23 '!driving',24 'upp_2_response = "none"',25 'sst_available = 1',26}27env_safe = {28 "sensor_failure -> sensor_failure'",29 '''!upp_2_request -> (upp_2_response' = "none")''',30 '''upp_2_request -> 31 ((upp_2_response' = "success"))''',32 ''' active_path = "sst" -> sst_available' > 0 ''',33 '''(!(driving & active_path="up2") & !goal) -> !goal' ''',34 '''(!driving & goal) -> goal' ''',35 '''(!driving & safe_stopped) -> safe_stopped' ''',36 '''(active_path!="sst" & !safe_stopped) -> !safe_stopped' ''',37 '''(!driving & emergency_stopped) -> emergency_stopped' ''',38 '''(active_path!="aeb" & !emergency_stopped) -> !emergency_stopped' ''',39 '''driving' -> active_path != "none"''',40 'goal -> !driving',41 'safe_stopped -> !driving',42 'emergency_stopped -> !driving',43 '''(!driving & active_path = "sst") -> safe_stopped' ''',44 '''(!driving & active_path = "aeb") -> emergency_stopped' ''',45}46env_prog = {47 '(active_path!="up2" | sensor_failure) | goal',48 '(active_path!="sst" | sst_available = 0) | safe_stopped',49 'active_path!="aeb" | emergency_stopped',50}51# %%52sys_vars = {53 'upp_2_request': 'boolean',54 'active_path': ['none', 'up2', 'sst', 'aeb'],55 'up_2_available': 'boolean',56}57sys_init = {58 '!upp_2_request',59 'active_path = "none"',60 '!up_2_available',61}62sys_safe = {63 '''active_path="sst" -> sst_available > 0''',64 '''(upp_2_response = "success") -> up_2_available' ''',65 '''(upp_2_response != "success") -> (up_2_available' <-> up_2_available) ''',66 '''safe_stopped -> (sensor_failure)''',67 '''safe_stopped -> !goal''',68 '''emergency_stopped -> (sensor_failure)''',69 '''emergency_stopped -> !goal''',70 '''emergency_stopped -> !safe_stopped''',71 '''(active_path = "up2" & driving') -> active_path' != "none" ''',72 '''goal -> active_path="none"''',73}74sys_prog = {75 'goal | safe_stopped | emergency_stopped',76 '!driving',77}78# %%79specs = spec.GRSpec(env_vars, sys_vars,80 env_init, sys_init,81 env_safe, sys_safe,82 env_prog, sys_prog)83specs.qinit = '\E \A'84specs.moore = False85specs.plus_one = False86# %%87ctrl = synth.synthesize(specs, ignore_sys_init=False, ignore_env_init=False)88# %%89ctrl._transition_dot_label_format['separator'] = r'\n'90ctrl.save('supervisor_simple_aeb.pdf')91# %%92with open('synthesized_controller_simple_aeb.pickle', 'wb') as f:...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { stopped } = require("qawolf");2const { chromium } = require("playwright");3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 await page.fill("input[name='q']", "Hello World");8 await page.press("input[name='q']", "Enter");9 await page.click("text=Hello World - Google Search");10 await stopped({ browser, context });11 await browser.close();12})();13await browser.close();14await context.close();15await page.close();16await browser.stop();17await context.stop();18await page.stop();19await browser.close();20await context.close();21await page.close();22await browser.stop();23await context.stop();24await page.stop();25await browser.stop();26await context.stop();27await page.stop();28await browser.close();29await context.close();30await page.close();31await page.waitForNavigation();32await browser.close();33await context.close();34await page.close();35await browser.stop();36await context.stop();37await page.stop();38await browser.close();39await context.close();40await page.close();41await browser.stop();42await context.stop();43await page.stop();44await browser.close();45await context.close();46await page.close();47await browser.stop();48await context.stop();49await page.stop();50await browser.close();51await context.close();52await page.close();53await browser.stop();54await context.stop();55await page.stop();56await browser.close();57await context.close();58await page.close();

Full Screen

Using AI Code Generation

copy

Full Screen

1const qawolf = require('qawolf');2(async () => {3 const browser = await qawolf.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await qawolf.stop();7})();8{9 "scripts": {10 },11 "dependencies": {12 }13}

Full Screen

Using AI Code Generation

copy

Full Screen

1const qawolf = require('qawolf');2const { chromium } = require('playwright');3(async () => {4 const browser = await chromium.launch({ headless: false });5 const context = await browser.newContext();6 const page = await context.newPage();7 await qawolf.stop();8})();9const qawolf = require('qawolf');10const { chromium } = require('playwright');11(async () => {12 const browser = await chromium.launch({ headless: false });13 const context = await browser.newContext();14 const page = await context.newPage();15 await qawolf.stop();16})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { launch, stop } = require("@qawolf/browser");2const { test } = require("@qawolf/test");3test("test", async () => {4 const browser = await launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 await page.fill("input[name=q]", "qawolf");8 await page.press("input[name=q]", "Enter");9 await page.click("text=QA Wolf: End-to-end browser testing for developers");10 await stop();11});

Full Screen

Using AI Code Generation

copy

Full Screen

1const { stopped } = require('qawolf');2const { test } = require('qawolf');3const selectors = require('./selectors');4describe('test', () => {5 let browser;6 beforeAll(async () => {7 browser = await qawolf.launch();8 });9 afterAll(async () => {10 await stopped(browser);11 });12 it('test', async () => {13 const context = await browser.newContext();14 const page = await context.newPage();15 await page.click(select

Full Screen

Using AI Code Generation

copy

Full Screen

1const { launch, stop } = require("qawolf");2(async () => {3 const browser = await launch();4 const context = await browser.newContext();5 await stop(browser);6})();7const { launch, stop } = require("qawolf");8(async () => {9 const browser = await launch();10 const context = await browser.newContext();11 await stop(browser);12})();13const { launch, stop } = require("qawolf");14(async () => {15 const browser = await launch();16 const context = await browser.newContext();17 await stop(browser);18})();19const { launch, stop } = require("qawolf");20(async () => {21 const browser = await launch();22 const context = await browser.newContext();23 await stop(browser);24})();25const { launch, stop } = require("qawolf");26(async () => {27 const browser = await launch();28 const context = await browser.newContext();29 await stop(browser);30})();31const { launch, stop } = require("qawolf");32(async () => {33 const browser = await launch();34 const context = await browser.newContext();35 await stop(browser);36})();37const { launch, stop } = require("qawolf");38(async () => {39 const browser = await launch();40 const context = await browser.newContext();41 await stop(browser);42})();

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run qawolf automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful