How to use integrations method in qawolf

Best JavaScript code snippet using qawolf

IntegrationRow.js

Source:IntegrationRow.js Github

copy

Full Screen

1/*2 * BLERP LLC ("BLERP") CONFIDENTIAL3 * Copyright (c) 2016 - 2017 Blerp LLC All Rights Reserved.4 * This file is subject to the terms and conditions defined in the file 'LICENSE',5 * which is at the root directory of this source code repository.6 */7import * as React from "react";8import styled from "styled-components";9import HoverIntegrationButton from "./HoverIntegrationButton";10import projectConfig from "../../config";11const mainHost = projectConfig.host;12const MainContainer = styled.div`13 overflow: hidden;14 display: flex;15 justify-content: center;16 align-items: center;17`;18const MainGrid = styled.div`19 display: grid;20 grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;21 grid-template-areas:22 ". . myArea myArea myArea . ."23 ". . myArea myArea myArea . .";24 align-content: center;25 justify-items: center;26 grid-gap: 28px;27 background-color: ${props =>28 props.isLight ? props.theme.flyoutBackground : props.theme.starling};29 min-height: 600px;30 position: relative;31 min-width: 110%;32`;33const HeadingText = styled.h2`34 font-weight: 300;35 padding: 16px 0;36 font-size: 52px;37 margin: 0;38 color: ${props =>39 props.isLight ? props.theme.bodyText : props.theme.flyoutBackground};40 text-align: center;41 z-index: 100;42 @media (max-width: 600px) {43 font-size: 40px;44 }45`;46const PurpleHeaderText = styled.p`47 font-weight: 600;48 display: inline;49 padding: 12px;50 font-size: 52px;51 padding: 4px;52 letter-spacing: 2px;53 text-decoration: none;54 color: ${props => props.theme.starling};55 text-align: center;56 width: 100%;57 @media (max-width: 600px) {58 font-size: 40px;59 }60`;61const Image = styled.img`62 position: absolute;63 top: 24px;64 border: none;65 left: 0;66 background-repeat: no-repeat;67 /* Preserve aspet ratio */68 max-width: 100%;69 min-height: 60%;70`;71const MainGridItem = styled.div`72 z-index: 10;73 grid-area: myArea;74`;75const GroupGridItem = styled.div`76 width: 130%;77 justify-content: center;78 z-index: 10;79 display: flex;80 align-items: center;81`;82class HomeHeader extends React.Component {83 constructor(props) {84 super(props);85 }86 render() {87 return (88 <MainContainer>89 <MainGrid isLight={true}>90 {this.props.hasScrolled && (91 <React.Fragment>92 <HoverIntegrationButton93 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}94 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest%20quite.svg'95 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest.svg'96 alt='Pinterest Logo'97 />98 <HoverIntegrationButton99 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}100 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/tumbler%20quite.svg'101 minWidth='40px'102 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Tumbler.svg'103 alt='Tumblr Logo'104 />105 </React.Fragment>106 )}107 <MainGridItem>108 <HeadingText isLight={true}>109 We{" "}110 <PurpleHeaderText href='/upload'>111 integrate112 </PurpleHeaderText>113 with the{" "}114 <PurpleHeaderText href='/upload'>115 most popular platforms116 </PurpleHeaderText>117 </HeadingText>118 </MainGridItem>119 {this.props.hasScrolled && (120 <React.Fragment>121 <HoverIntegrationButton122 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}123 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest%20quite.svg'124 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest.svg'125 alt='Pinterest Logo'126 />127 <HoverIntegrationButton128 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}129 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/tumbler%20quite.svg'130 minWidth='40px'131 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Tumbler.svg'132 alt='Tumblr Logo'133 />134 <HoverIntegrationButton135 linkUrl={`${mainHost}/discord`}136 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discord%20quite.svg'137 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discrod.svg'138 alt='Discor Logo'139 />140 <GroupGridItem>141 <HoverIntegrationButton142 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}143 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/twitter%20quite.svg'144 minWidth='60px'145 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitter.svg'146 alt='Twitter Logo'147 />148 <HoverIntegrationButton149 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}150 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage%20quite.svg'151 minWidth='48px'152 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage.svg'153 alt='iMessage Logo'154 />155 </GroupGridItem>156 <HoverIntegrationButton157 linkUrl={`${mainHost}/discord`}158 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discord%20quite.svg'159 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discrod.svg'160 alt='Discord Logo'161 />162 <GroupGridItem>163 <HoverIntegrationButton164 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}165 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/twitter%20quite.svg'166 minWidth='60px'167 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitter.svg'168 alt='Twitter Logo'169 />170 <HoverIntegrationButton171 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}172 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage%20quite.svg'173 minWidth='48px'174 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage.svg'175 alt='iMessage Logo'176 />177 </GroupGridItem>178 <HoverIntegrationButton179 linkUrl={`${mainHost}/twitch`}180 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch%20quite.svg'181 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch.svg'182 alt='Twitch Logo'183 />184 <HoverIntegrationButton185 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}186 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/facebook%20quite.svg'187 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Facebook.svg'188 alt='Facebook Logo'189 />190 <HoverIntegrationButton191 linkUrl={`${mainHost}/twitch`}192 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch%20quite.svg'193 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch.svg'194 alt='Twitch Logo'195 />196 <HoverIntegrationButton197 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}198 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/facebook%20quite.svg'199 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Facebook.svg'200 alt='Facebook Logo'201 />202 <HoverIntegrationButton203 linkUrl={`${mainHost}/twitch`}204 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch%20quite.svg'205 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch.svg'206 alt='Twitch Logo'207 />208 <HoverIntegrationButton209 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}210 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/facebook%20quite.svg'211 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Facebook.svg'212 alt='Facebook Logo'213 />214 <HoverIntegrationButton215 linkUrl={`${mainHost}/twitch`}216 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch%20quite.svg'217 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch.svg'218 alt='Twitch Logo'219 />220 <HoverIntegrationButton221 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}222 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/redit%20quite.svg'223 minWidth='60px'224 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/redit.svg'225 alt='Reddit Logo'226 />227 <GroupGridItem>228 <HoverIntegrationButton229 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}230 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/ios%20quite.svg'231 minWidth='48px'232 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/ios.svg'233 alt='iOS App Store Logo'234 />235 <HoverIntegrationButton236 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}237 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/android%20quite.svg'238 minWidth='40px'239 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/android.svg'240 alt='Android Play Store Logo'241 />242 </GroupGridItem>243 <HoverIntegrationButton244 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}245 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/redit%20quite.svg'246 minWidth='60px'247 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/redit.svg'248 alt='Reddit Logo'249 />250 <GroupGridItem>251 <HoverIntegrationButton252 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}253 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/ios%20quite.svg'254 minWidth='48px'255 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/ios.svg'256 alt='iOS App Store Logo'257 />258 <HoverIntegrationButton259 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}260 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/android%20quite.svg'261 minWidth='40px'262 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/android.svg'263 alt='Android Play Store Logo'264 />265 </GroupGridItem>266 <HoverIntegrationButton267 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}268 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/redit%20quite.svg'269 minWidth='60px'270 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/redit.svg'271 alt='Reddit Logo'272 />273 <GroupGridItem>274 <HoverIntegrationButton275 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}276 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/ios%20quite.svg'277 minWidth='48px'278 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/ios.svg'279 alt='iOs Logo'280 />281 <HoverIntegrationButton282 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}283 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/android%20quite.svg'284 minWidth='40px'285 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/android.svg'286 alt='Android Play Store Logo'287 />288 </GroupGridItem>289 <HoverIntegrationButton290 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}291 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/redit%20quite.svg'292 minWidth='60px'293 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/redit.svg'294 alt='Reddit Logo'295 />296 <HoverIntegrationButton297 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}298 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest%20quite.svg'299 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest.svg'300 alt='Pinterest Logo'301 />302 <HoverIntegrationButton303 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}304 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/tumbler%20quite.svg'305 minWidth='40px'306 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Tumbler.svg'307 alt='Tumblr Logo'308 />309 <HoverIntegrationButton310 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}311 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest%20quite.svg'312 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest.svg'313 alt='Pinterest Logo'314 />315 <HoverIntegrationButton316 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}317 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/tumbler%20quite.svg'318 minWidth='40px'319 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Tumbler.svg'320 alt='Tumblr Logo'321 />322 <HoverIntegrationButton323 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}324 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest%20quite.svg'325 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest.svg'326 alt='Pinterest Logo'327 />328 <HoverIntegrationButton329 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}330 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/tumbler%20quite.svg'331 minWidth='40px'332 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Tumbler.svg'333 alt='Tumblr Logo'334 />335 <HoverIntegrationButton336 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}337 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest%20quite.svg'338 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Pinterest.svg'339 alt='Pinterest Logo'340 />341 <HoverIntegrationButton342 linkUrl={`${mainHost}/discord`}343 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discord%20quite.svg'344 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discrod.svg'345 alt='Discord Logo'346 />347 <GroupGridItem>348 <HoverIntegrationButton349 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}350 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/twitter%20quite.svg'351 minWidth='60px'352 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitter.svg'353 alt='Twitter Logo'354 />355 <HoverIntegrationButton356 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}357 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage%20quite.svg'358 minWidth='48px'359 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage.svg'360 alt='iMessage Logo'361 />362 </GroupGridItem>363 <HoverIntegrationButton364 linkUrl={`${mainHost}/discord`}365 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discord%20quite.svg'366 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discrod.svg'367 alt='Discord Logo'368 />369 <GroupGridItem>370 <HoverIntegrationButton371 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}372 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/twitter%20quite.svg'373 minWidth='60px'374 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitter.svg'375 alt='TWitter Logo'376 />377 <HoverIntegrationButton378 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}379 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage%20quite.svg'380 minWidth='48px'381 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage.svg'382 alt='iMessage Logo'383 />384 </GroupGridItem>385 <HoverIntegrationButton386 linkUrl={`${mainHost}/discord`}387 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discord%20quite.svg'388 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discrod.svg'389 alt='Discord Logo'390 />391 <GroupGridItem>392 <HoverIntegrationButton393 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}394 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/twitter%20quite.svg'395 minWidth='60px'396 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitter.svg'397 alt='Twitter Logo'398 />399 <HoverIntegrationButton400 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}401 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage%20quite.svg'402 minWidth='48px'403 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/imessage.svg'404 alt='iMessage Logo'405 />406 </GroupGridItem>407 <HoverIntegrationButton408 linkUrl={`${mainHost}/discord`}409 mainImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discord%20quite.svg'410 hoverImage='https://storage.googleapis.com/blerp_products/Web/Home/integrations/Discrod.svg'411 alt='Discord Logo'412 />413 </React.Fragment>414 )}415 {/* 416 <HoverIntegrationButton417 linkUrl={`${mainHost}/twitch`}418 mainImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch%20quite.svg"419 hoverImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch.svg"420 />421 <HoverIntegrationButton422 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}423 mainImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/facebook%20quite.svg"424 hoverImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Facebook.svg"425 />426 <HoverIntegrationButton427 linkUrl={`${mainHost}/twitch`}428 mainImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch%20quite.svg"429 hoverImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch.svg"430 />431 <HoverIntegrationButton432 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}433 mainImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/facebook%20quite.svg"434 hoverImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Facebook.svg"435 />436 <HoverIntegrationButton437 linkUrl={`${mainHost}/twitch`}438 mainImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch%20quite.svg"439 hoverImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch.svg"440 />441 <HoverIntegrationButton442 linkUrl={`${mainHost}/soundboard-products/mobile-apps`}443 mainImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/facebook%20quite.svg"444 hoverImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Facebook.svg"445 />446 <HoverIntegrationButton447 linkUrl={`${mainHost}/twitch`}448 mainImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch%20quite.svg"449 hoverImage="https://storage.googleapis.com/blerp_products/Web/Home/integrations/Twitch.svg"450 /> */}451 {this.props.hasScrolled && (452 <Image453 src='https://storage.googleapis.com/blerp_products/Web/product_page/purple%20blerp%20texture.svg'454 alt='Sound background image of purple blerps'455 />456 )}457 </MainGrid>458 </MainContainer>459 );460 }461}...

Full Screen

Full Screen

07-incoming-integrations.js

Source:07-incoming-integrations.js Github

copy

Full Screen

1import { expect } from 'chai';2import { getCredentials, api, request, credentials } from '../../data/api-data.js';3import { updatePermission } from '../../data/permissions.helper';4import { createIntegration, removeIntegration } from '../../data/integration.helper';5import { createUser, login } from '../../data/users.helper';6import { password } from '../../data/user';7describe('[Incoming Integrations]', function() {8 this.retries(0);9 let integration;10 let integrationCreatedByAnUser;11 let user;12 let userCredentials;13 before((done) => getCredentials(done));14 before((done) => {15 updatePermission('manage-incoming-integrations', [])16 .then(() => updatePermission('manage-own-incoming-integrations', []))17 .then(() => updatePermission('manage-own-outgoing-integrations', []))18 .then(() => updatePermission('manage-outgoing-integrations', []))19 .then(done);20 });21 after((done) => {22 updatePermission('manage-incoming-integrations', ['admin'])23 .then(() => updatePermission('manage-own-incoming-integrations', ['admin']))24 .then(() => updatePermission('manage-own-outgoing-integrations', ['admin']))25 .then(() => updatePermission('manage-outgoing-integrations', ['admin']))26 .then(done);27 });28 describe('[/integrations.create]', () => {29 it('should return an error when the user DOES NOT have the permission "manage-incoming-integrations" to add an incoming integration', (done) => {30 updatePermission('manage-incoming-integrations', []).then(() => {31 request.post(api('integrations.create'))32 .set(credentials)33 .send({34 type: 'webhook-incoming',35 name: 'Incoming test',36 enabled: true,37 alias: 'test',38 username: 'rocket.cat',39 scriptEnabled: false,40 channel: '#general',41 })42 .expect('Content-Type', 'application/json')43 .expect(400)44 .expect((res) => {45 expect(res.body).to.have.property('success', false);46 expect(res.body).to.have.property('errorType', 'not_authorized');47 })48 .end(done);49 });50 });51 it('should return an error when the user DOES NOT have the permission "manage-own-incoming-integrations" to add an incoming integration', (done) => {52 updatePermission('manage-own-incoming-integrations', []).then(() => {53 request.post(api('integrations.create'))54 .set(credentials)55 .send({56 type: 'webhook-incoming',57 name: 'Incoming test',58 enabled: true,59 alias: 'test',60 username: 'rocket.cat',61 scriptEnabled: false,62 channel: '#general',63 })64 .expect('Content-Type', 'application/json')65 .expect(400)66 .expect((res) => {67 expect(res.body).to.have.property('success', false);68 expect(res.body).to.have.property('errorType', 'not_authorized');69 })70 .end(done);71 });72 });73 it('should return an error when the user sends an invalid type of integration', (done) => {74 request.post(api('integrations.create'))75 .set(credentials)76 .send({77 type: 'webhook-incoming-invalid',78 name: 'Incoming test',79 enabled: true,80 alias: 'test',81 username: 'rocket.cat',82 scriptEnabled: false,83 channel: '#general',84 })85 .expect('Content-Type', 'application/json')86 .expect(400)87 .expect((res) => {88 expect(res.body).to.have.property('success', false);89 expect(res.body).to.have.property('error', 'Invalid integration type.');90 })91 .end(done);92 });93 it('should add the integration successfully when the user ONLY has the permission "manage-incoming-integrations" to add an incoming integration', (done) => {94 let integrationId;95 updatePermission('manage-own-incoming-integrations', ['admin']).then(() => {96 request.post(api('integrations.create'))97 .set(credentials)98 .send({99 type: 'webhook-incoming',100 name: 'Incoming test',101 enabled: true,102 alias: 'test',103 username: 'rocket.cat',104 scriptEnabled: false,105 channel: '#general',106 })107 .expect('Content-Type', 'application/json')108 .expect(200)109 .expect((res) => {110 expect(res.body).to.have.property('success', true);111 expect(res.body).to.have.property('integration').and.to.be.an('object');112 integrationId = res.body.integration._id;113 })114 .end(() => removeIntegration(integrationId, 'incoming').then(done));115 });116 });117 it('should add the integration successfully when the user ONLY has the permission "manage-own-incoming-integrations" to add an incoming integration', (done) => {118 updatePermission('manage-incoming-integrations', []).then(() => {119 updatePermission('manage-own-incoming-integrations', ['admin']).then(() => {120 request.post(api('integrations.create'))121 .set(credentials)122 .send({123 type: 'webhook-incoming',124 name: 'Incoming test 2',125 enabled: true,126 alias: 'test2',127 username: 'rocket.cat',128 scriptEnabled: false,129 channel: '#general',130 })131 .expect('Content-Type', 'application/json')132 .expect(200)133 .expect((res) => {134 expect(res.body).to.have.property('success', true);135 expect(res.body).to.have.property('integration').and.to.be.an('object');136 integration = res.body.integration;137 })138 .end(done);139 });140 });141 });142 it('should execute the incoming integration', (done) => {143 request.post(`/hooks/${ integration._id }/${ integration.token }`)144 .send({145 text: 'Example message',146 })147 .expect(200)148 .end(done);149 });150 });151 describe('[/integrations.history]', () => {152 it('should return an error when trying to get history of incoming integrations', (done) => {153 request.get(api('integrations.history'))154 .set(credentials)155 .query({156 id: integration._id,157 })158 .expect('Content-Type', 'application/json')159 .expect(403)160 .expect((res) => {161 expect(res.body).to.have.property('success', false);162 expect(res.body).to.have.property('error', 'unauthorized');163 })164 .end(done);165 });166 });167 describe('[/integrations.list]', () => {168 before((done) => {169 createUser().then((createdUser) => {170 user = createdUser;171 login(user.username, password).then((credentials) => {172 userCredentials = credentials;173 updatePermission('manage-incoming-integrations', ['user']).then(() => {174 createIntegration({175 type: 'webhook-incoming',176 name: 'Incoming test',177 enabled: true,178 alias: 'test',179 username: 'rocket.cat',180 scriptEnabled: false,181 channel: '#general',182 }, userCredentials).then((integration) => {183 integrationCreatedByAnUser = integration;184 done();185 });186 });187 });188 });189 });190 it('should return the list of incoming integrations', (done) => {191 request.get(api('integrations.list'))192 .set(credentials)193 .expect('Content-Type', 'application/json')194 .expect(200)195 .expect((res) => {196 expect(res.body).to.have.property('success', true);197 const integrationCreatedByAdmin = res.body.integrations.find((createdIntegration) => createdIntegration._id === integration._id);198 expect(integrationCreatedByAdmin).to.be.an('object');199 expect(integrationCreatedByAdmin._id).to.be.equal(integration._id);200 expect(res.body).to.have.property('offset');201 expect(res.body).to.have.property('items');202 expect(res.body).to.have.property('total');203 })204 .end(done);205 });206 it('should return the list of integrations created by the user only', (done) => {207 updatePermission('manage-incoming-integrations', []).then(() => {208 updatePermission('manage-own-incoming-integrations', ['user']).then(() => {209 request.get(api('integrations.list'))210 .set(userCredentials)211 .expect('Content-Type', 'application/json')212 .expect(200)213 .expect((res) => {214 expect(res.body).to.have.property('success', true);215 const integrationCreatedByAdmin = res.body.integrations.find((createdIntegration) => createdIntegration._id === integration._id);216 expect(integrationCreatedByAdmin).to.be.equal(undefined);217 expect(res.body).to.have.property('offset');218 expect(res.body).to.have.property('items');219 expect(res.body).to.have.property('total');220 })221 .end(done);222 });223 });224 });225 it('should return unauthorized error when the user does not have any integrations permissions', (done) => {226 updatePermission('manage-incoming-integrations', []).then(() => {227 updatePermission('manage-own-incoming-integrations', []).then(() => {228 updatePermission('manage-outgoing-integrations', []).then(() => {229 updatePermission('manage-outgoing-integrations', []).then(() => {230 request.get(api('integrations.list'))231 .set(credentials)232 .expect('Content-Type', 'application/json')233 .expect(403)234 .expect((res) => {235 expect(res.body).to.have.property('success', false);236 expect(res.body).to.have.property('error', 'unauthorized');237 })238 .end(done);239 });240 });241 });242 });243 });244 });245 describe('[/integrations.get]', () => {246 it('should return an error when the required "integrationId" query parameters is not sent', (done) => {247 request.get(api('integrations.get'))248 .set(credentials)249 .expect('Content-Type', 'application/json')250 .expect(400)251 .expect((res) => {252 expect(res.body).to.have.property('success', false);253 expect(res.body).to.have.property('error', 'The query parameter "integrationId" is required.');254 })255 .end(done);256 });257 it('should return an error when the user DOES NOT have the permission "manage-incoming-integrations" to get an incoming integration', (done) => {258 updatePermission('manage-incoming-integrations', []).then(() => {259 request.get(api(`integrations.get?integrationId=${ integration._id }`))260 .set(credentials)261 .expect('Content-Type', 'application/json')262 .expect(400)263 .expect((res) => {264 expect(res.body).to.have.property('success', false);265 expect(res.body).to.have.property('error', 'not-authorized');266 })267 .end(done);268 });269 });270 it('should return an error when the user DOES NOT have the permission "manage-incoming-integrations" to get an incoming integration created by another user', (done) => {271 updatePermission('manage-incoming-integrations', []).then(() => {272 request.get(api(`integrations.get?integrationId=${ integrationCreatedByAnUser._id }`))273 .set(credentials)274 .expect('Content-Type', 'application/json')275 .expect(400)276 .expect((res) => {277 expect(res.body).to.have.property('success', false);278 expect(res.body).to.have.property('error', 'not-authorized');279 })280 .end(done);281 });282 });283 it('should return an error when the user sends an invalid integration', (done) => {284 updatePermission('manage-incoming-integrations', ['admin']).then(() => {285 request.get(api('integrations.get?integrationId=invalid'))286 .set(credentials)287 .expect('Content-Type', 'application/json')288 .expect(400)289 .expect((res) => {290 expect(res.body).to.have.property('success', false);291 expect(res.body).to.have.property('error', 'The integration does not exists.');292 })293 .end(done);294 });295 });296 it('should return the integration successfully when the user is able to see only your own integrations', (done) => {297 updatePermission('manage-incoming-integrations', [])298 .then(() => updatePermission('manage-own-incoming-integrations', ['user']))299 .then(() => {300 request.get(api(`integrations.get?integrationId=${ integrationCreatedByAnUser._id }`))301 .set(userCredentials)302 .expect('Content-Type', 'application/json')303 .expect(200)304 .expect((res) => {305 expect(res.body).to.have.property('success', true);306 expect(res.body).to.have.property('integration');307 expect(res.body.integration._id).to.be.equal(integrationCreatedByAnUser._id);308 })309 .end(done);310 });311 });312 it('should return the integration successfully', (done) => {313 updatePermission('manage-incoming-integrations', ['admin']).then(() => {314 request.get(api(`integrations.get?integrationId=${ integration._id }`))315 .set(credentials)316 .expect('Content-Type', 'application/json')317 .expect(200)318 .expect((res) => {319 expect(res.body).to.have.property('success', true);320 expect(res.body).to.have.property('integration');321 expect(res.body.integration._id).to.be.equal(integration._id);322 })323 .end(done);324 });325 });326 });327 describe('[/integrations.update]', () => {328 it('should update an integration by id and return the new data', (done) => {329 request.put(api('integrations.update'))330 .set(credentials)331 .send({332 type: 'webhook-incoming',333 name: 'Incoming test updated',334 enabled: true,335 alias: 'test updated',336 username: 'rocket.cat',337 scriptEnabled: true,338 channel: '#general',339 integrationId: integration._id,340 })341 .expect('Content-Type', 'application/json')342 .expect(200)343 .expect((res) => {344 expect(res.body).to.have.property('success', true);345 expect(res.body).to.have.property('integration');346 expect(res.body.integration._id).to.be.equal(integration._id);347 expect(res.body.integration.name).to.be.equal('Incoming test updated');348 expect(res.body.integration.alias).to.be.equal('test updated');349 })350 .end(done);351 });352 it('should have integration updated on subsequent gets', (done) => {353 request.get(api(`integrations.get?integrationId=${ integration._id }`))354 .set(credentials)355 .expect('Content-Type', 'application/json')356 .expect(200)357 .expect((res) => {358 expect(res.body).to.have.property('success', true);359 expect(res.body).to.have.property('integration');360 expect(res.body.integration._id).to.be.equal(integration._id);361 expect(res.body.integration.name).to.be.equal('Incoming test updated');362 expect(res.body.integration.alias).to.be.equal('test updated');363 })364 .end(done);365 });366 });367 describe('[/integrations.remove]', () => {368 it('should return an error when the user DOES NOT have the permission "manage-incoming-integrations" to remove an incoming integration', (done) => {369 updatePermission('manage-incoming-integrations', []).then(() => {370 request.post(api('integrations.remove'))371 .set(credentials)372 .send({373 integrationId: integration._id,374 })375 .expect('Content-Type', 'application/json')376 .expect(403)377 .expect((res) => {378 expect(res.body).to.have.property('success', false);379 expect(res.body).to.have.property('error', 'unauthorized');380 })381 .end(done);382 });383 });384 it('should return an error when the user DOES NOT have the permission "manage-own-incoming-integrations" to remove an incoming integration', (done) => {385 updatePermission('manage-own-incoming-integrations', []).then(() => {386 request.post(api('integrations.remove'))387 .set(credentials)388 .send({389 integrationId: integration._id,390 })391 .expect('Content-Type', 'application/json')392 .expect(403)393 .expect((res) => {394 expect(res.body).to.have.property('success', false);395 expect(res.body).to.have.property('error', 'unauthorized');396 })397 .end(done);398 });399 });400 it('should return an error when the user sends an invalid type of integration', (done) => {401 updatePermission('manage-own-incoming-integrations', ['admin']).then(() => {402 request.post(api('integrations.remove'))403 .set(credentials)404 .send({405 integrationId: integration._id,406 type: 'invalid-type',407 })408 .expect('Content-Type', 'application/json')409 .expect(400)410 .expect((res) => {411 expect(res.body).to.have.property('success', false);412 expect(res.body).to.have.property('error', 'Invalid integration type.');413 })414 .end(done);415 });416 });417 it('should remove the integration successfully when the user at least one of the necessary permission to remove an incoming integration', (done) => {418 updatePermission('manage-incoming-integrations', ['admin']).then(() => {419 request.post(api('integrations.remove'))420 .set(credentials)421 .send({422 integrationId: integration._id,423 type: integration.type,424 })425 .expect('Content-Type', 'application/json')426 .expect(200)427 .expect((res) => {428 expect(res.body).to.have.property('success', true);429 })430 .end(done);431 });432 });433 it('the normal user should remove the integration successfully when the user have the "manage-own-incoming-integrations" to remove an incoming integration', (done) => {434 updatePermission('manage-own-incoming-integrations', ['user']).then(() => {435 request.post(api('integrations.remove'))436 .set(userCredentials)437 .send({438 integrationId: integrationCreatedByAnUser._id,439 type: integrationCreatedByAnUser.type,440 })441 .expect('Content-Type', 'application/json')442 .expect(200)443 .expect((res) => {444 expect(res.body).to.have.property('success', true);445 })446 .end(done);447 });448 });449 });...

Full Screen

Full Screen

route.js

Source:route.js Github

copy

Full Screen

1import { Meteor } from 'meteor/meteor';2import { FlowRouter } from 'meteor/kadira:flow-router';3import { BlazeLayout } from 'meteor/kadira:blaze-layout';4import { t } from 'meteor/rocketchat:utils';5FlowRouter.route('/admin/integrations', {6 name: 'admin-integrations',7 subscriptions() {8 this.register('integrations', Meteor.subscribe('integrations'));9 },10 action() {11 return BlazeLayout.render('main', {12 center: 'integrations',13 pageTitle: t('Integrations'),14 });15 },16});17FlowRouter.route('/admin/integrations/new', {18 name: 'admin-integrations-new',19 subscriptions() {20 this.register('integrations', Meteor.subscribe('integrations'));21 },22 action() {23 return BlazeLayout.render('main', {24 center: 'integrationsNew',25 pageTitle: t('Integration_New'),26 });27 },28});29FlowRouter.route('/admin/integrations/incoming/:id?', {30 name: 'admin-integrations-incoming',31 subscriptions() {32 this.register('integrations', Meteor.subscribe('integrations'));33 },34 action(params) {35 return BlazeLayout.render('main', {36 center: 'pageSettingsContainer',37 pageTitle: t('Integration_Incoming_WebHook'),38 pageTemplate: 'integrationsIncoming',39 params,40 });41 },42});43FlowRouter.route('/admin/integrations/outgoing/:id?', {44 name: 'admin-integrations-outgoing',45 action(params) {46 return BlazeLayout.render('main', {47 center: 'integrationsOutgoing',48 pageTitle: t('Integration_Outgoing_WebHook'),49 params,50 });51 },52});53FlowRouter.route('/admin/integrations/outgoing/:id?/history', {54 name: 'admin-integrations-outgoing-history',55 action(params) {56 return BlazeLayout.render('main', {57 center: 'integrationsOutgoingHistory',58 pageTitle: t('Integration_Outgoing_WebHook_History'),59 params,60 });61 },62});63FlowRouter.route('/admin/integrations/additional/zapier', {64 name: 'admin-integrations-additional-zapier',65 action() {66 BlazeLayout.render('main', {67 center: 'integrationsAdditionalZapier',68 });69 },...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require("playwright");2const { test } = require("qawolf");3let browser;4let page;5beforeAll(async () => {6 browser = await chromium.launch();7});8afterAll(async () => {9 await browser.close();10});11beforeEach(async () => {12 page = await browser.newPage();13});14afterEach(async () => {15 await page.close();16});17test("google", async () => {18 await page.fill("input[name=q]", "qawolf");19 await page.click("input[value='Google Search']");20 await page.click("input[value='I'm Feeling Lucky']");21});22const { chromium } = require("playwright");23const { test } = require("qawolf");24let browser;25let page;26beforeAll(async () => {27 browser = await chromium.launch();28});29afterAll(async () => {30 await browser.close();31});32beforeEach(async () => {33 page = await browser.newPage();34});35afterEach(async () => {36 await page.close();37});38test("google", async () => {39 await page.fill("input[name=q]", "qawolf");40 await page.click("input[value='Google Search']");41 await page.click("input[value='I'm Feeling Lucky']");42});43const { chromium } = require("playwright");44const { test } = require("qawolf");45let browser;46let page;47beforeAll(async () => {48 browser = await chromium.launch();49});50afterAll(async () => {51 await browser.close();52});53beforeEach(async () => {54 page = await browser.newPage();55});56afterEach(async () => {57 await page.close();58});59test("google", async () => {60 await page.fill("input[name=q]", "qawolf");61 await page.click("input[value='Google Search']");62 await page.click("input[value='I'm Feeling Lucky']");63});64const { chromium } = require("playwright");65const { test } = require("qawolf");66let browser;67let page;68beforeAll(async () => {69 browser = await chromium.launch();70});

Full Screen

Using AI Code Generation

copy

Full Screen

1const { launch, firefox } = require('qawolf');2const { test, expect } = require('@playwright/test');3test.describe('test', () => {4 let browser;5 let page;6 test.beforeAll(async () => {7 browser = await launch({8 launchOptions: { headless: false },9 });10 });11 test.beforeEach(async () => {12 page = await browser.newPage();13 });14 test.afterAll(async () => {15 await browser.close();16 });17 test('test', async () => {18 await page.click('input[name="q"]');19 await page.fill('input[name="q"]', 'test');20 await page.click('input[name="btnK"]');21 await page.waitForSelector('h3');22 const title = await page.innerText('h3');23 expect(title).toBe('test - Google Search');24 });25});26import { test, expect } from '@playwright/test';27test('test', async ({ page }) => {28 await page.click('input[name="q"]');29 await page.fill('input[name="q"]', 'test');30 await page.click('input[name="btnK"]');31 await page.waitForSelector('h3');32 const title = await page.innerText('h3');33 expect(title).toBe('test - Google Search');34});

Full Screen

Using AI Code Generation

copy

Full Screen

1const qawolf = require("qawolf");2const browser = await qawolf.launch();3const page = await browser.newPage();4await qawolf.scroll(page, "html", { x: 0, y: 0 });5await qawolf.click(page, "input[name='q']");6await qawolf.type(page, "input[name='q']", "hello");7await qawolf.click(page, "input[type='submit']");8await qawolf.click(page, "input[type='submit']");9await qawolf.click(page, "input[type='submit']");10await qawolf.click(page, "input[type='submit']");11await qawolf.click(page, "input[type='submit']");12await qawolf.click(page, "input[type='submit']");13await qawolf.click(page, "input[type='submit']");14await qawolf.click(page, "input[type='submit']");15await qawolf.click(page, "input[type='submit']");16await qawolf.click(page, "input[type='submit']");

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require("qawolf");2const { devices } = require("playwright");3const iPhone = devices["iPhone 11 Pro"];4(async () => {5 const browser = await chromium.launch({ headless: false });6 const context = await browser.newContext({7 geolocation: { longitude: 12.492507, latitude: 41.889938 },8 });9 const page = await context.newPage();10 await page.click("input[type=text]");11 await page.fill("input[type=text]", "qawolf");12 await page.press("input[type=text]", "Enter");13 await page.click("text=QA Wolf: Create browser tests in minutes");14 await page.click("text=Start free tri

Full Screen

Using AI Code Generation

copy

Full Screen

1const { launch, devices, selectors } = require('qawolf');2const browser = await launch();3const page = await browser.newPage();4await page.setViewport(devices['iPhone 8']);5await page.click(selectors[0]);6await page.fill(selectors[0], 'hello world');7await page.press(selectors[0], 'Enter');8await browser.close();9const { launch, devices, selectors } = require('qawolf');10const browser = await launch();11const page = await browser.newPage();12await page.setViewport(devices['iPhone 8']);13await page.click(selectors[0]);14await page.fill(selectors[0], 'hello world');15await page.press(selectors[0], 'Enter');16await browser.close();17const { launch, devices, selectors } = require('qawolf');18const browser = await launch();19const page = await browser.newPage();20await page.setViewport(devices['iPhone 8']);21await page.click(selectors[0]);22await page.fill(selectors[0], 'hello world');23await page.press(selectors[0], 'Enter');24await browser.close();25const { launch, devices, selectors } = require('qawolf');26const browser = await launch();27const page = await browser.newPage();28await page.setViewport(devices['iPhone 8']);

Full Screen

Using AI Code Generation

copy

Full Screen

1const { firefox } = require("playwright");2const qawolf = require("qawolf");3describe("test", () => {4 let browser;5 let page;6 beforeAll(async () => {7 browser = await firefox.launch();8 });9 afterAll(async () => {10 await browser.close();11 });12 beforeEach(async () => {13 page = await browser.newPage();14 await qawolf.register(page);15 });16 afterEach(async () => {17 await page.close();18 });19 it("test", async () => {20 await page.click("#L2AGLb > div");21 await page.fill("#lst-ib", "hello world");22 await page.press("#lst-ib", "Enter");23 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1) > div > div > h3 > a");24 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1) > div > div > h3 > a");25 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1) > div > div > h3 > a");26 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1) > div > div > h3 > a");27 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1) > div > div > h3 > a");28 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1) > div > div > h3 > a");29 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1) > div > div > h3 > a");30 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1) > div > div > h3 > a");31 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1) > div > div > h3 > a");32 await page.click("#rso > div:nth-child(1) > div > div:nth-child(1

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('qawolf');2const { getOptions } = require('qawolf/src/integrations');3const { launch } = require('qawolf/src/browserLauncher');4const { createRecorder } = require('qawolf/src/recorder');5const { createActions } = require('qawolf/src/actions');6const browser = await chromium.launch();7const page = await browser.newPage();8await page.type('input[name="q"]', 'qawolf');9await page.press('input[name="q"]', 'Enter');10await browser.close();11const { chromium } = require('qawolf');12const { getOptions } = require('qawolf/src/integrations');13const { launch } = require('qawolf/src/browserLauncher');14const { createRecorder } = require('qawolf/src/recorder');15const { createActions } = require('qawolf/src/actions');16const browser = await chromium.launch();17const page = await browser.newPage();18await page.type('input[name="q"]', 'qawolf');19await page.press('input[name="q"]', 'Enter');20await browser.close();

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