How to use net.uploadFile method in Appium Android Driver

Best JavaScript code snippet using appium-android-driver

HomePage.jsx

Source:HomePage.jsx Github

copy

Full Screen

1// import React, { Fragment } from "react";2import {Link} from 'react-router-dom';3import NavbarComponent from "../shared/components/NavbarComponent";4function HomePage() {5    return (6        <div className="container">7            <NavbarComponent />8            <h1>FatCat escrito con estilo chingón y centradito</h1>9            <br />10            <h2>Productos más vendidos</h2>11            <div className="row">12                <div class="col-12 col-sm-6 col-md-4 col-lg-3">13                    <div class="card">14                        <img src="https://studiosol-a.akamaihd.net/uploadfile/letras/fotos/7/6/5/a/765afb557fabd371fd0a3ba386728100.jpg" class="card-img-top" alt="..." />15                        <div class="card-body">16                            <h5 class="card-title">Killua Zoldyck</h5>17                            <p class="card-text">Valor: $0.</p>18                            <p class="card-text">No está a la venta we, pero mírate el anime que está weno</p>19                        </div>20                    </div>21                </div>22                <div class="col-12 col-sm-6 col-md-4 col-lg-3">23                    <div class="card">24                        <img src="https://pm1.narvii.com/6339/4561c888660d8f0cb804ce8d01bd125e4d26a22b_hq.jpg" class="card-img-top" alt="..." />25                        <div class="card-body">26                            <h5 class="card-title">Gon Freecss</h5>27                            <p class="card-text">Valor: $0.</p>28                            <p class="card-text">Da buenos cabezasos, ideal para abrir candados y otras cosas</p>29                        </div>30                    </div>31                </div>32                <div class="col-12 col-sm-6 col-md-4 col-lg-3">33                    <div class="card">34                        <img src="https://www.radiodemente.cl/wp-content/uploads/2020/04/Leorio.jpg" class="card-img-top" alt="..." />35                        <div class="card-body">36                            <h5 class="card-title">Leorio Dono</h5>37                            <p class="card-text">Valor: $0.</p>38                            <p class="card-text">Médico y sugar daddy en toda regla, llévalo y te paga la universidad</p>39                        </div>40                    </div>41                </div>42                <div class="col-12 col-sm-6 col-md-4 col-lg-3">43                    <div class="card">44                        <img src="https://areajugones.sport.es/wp-content/uploads/2020/09/hisoka-hunter-x-hunter.jpg" class="card-img-top" alt="..." />45                        <div class="card-body">46                            <h5 class="card-title">Hisoka Hijuemadre</h5>47                            <p class="card-text">Valor: $0.</p>48                            <p class="card-text">Es un Husbando pelogroso, pero a ti te gusta el peligro</p>49                        </div>50                    </div>51                </div>52            </div>53            <br /><br /><br />54            <h2>Alguna otra categoría</h2>55            <br />56            <div className="row">57                <div class="col-12 col-sm-6 col-md-4 col-lg-3">58                    <div class="card">59                        <img src="https://studiosol-a.akamaihd.net/uploadfile/letras/fotos/7/6/5/a/765afb557fabd371fd0a3ba386728100.jpg" class="card-img-top" alt="..." />60                        <div class="card-body">61                            <h5 class="card-title">Killua Zoldyck</h5>62                            <p class="card-text">Valor: $0.</p>63                            <p class="card-text">No está a la venta we, pero mírate el anime que está weno</p>64                        </div>65                    </div>66                </div>67                <div class="col-12 col-sm-6 col-md-4 col-lg-3">68                    <div class="card">69                        <img src="https://pm1.narvii.com/6339/4561c888660d8f0cb804ce8d01bd125e4d26a22b_hq.jpg" class="card-img-top" alt="..." />70                        <div class="card-body">71                            <h5 class="card-title">Gon Freecss</h5>72                            <p class="card-text">Valor: $0.</p>73                            <p class="card-text">Da buenos cabezasos, ideal para abrir candados y otras cosas</p>74                        </div>75                    </div>76                </div>77                <div class="col-12 col-sm-6 col-md-4 col-lg-3">78                    <div class="card">79                        <img src="https://www.radiodemente.cl/wp-content/uploads/2020/04/Leorio.jpg" class="card-img-top" alt="..." />80                        <div class="card-body">81                            <h5 class="card-title">Leorio Dono</h5>82                            <p class="card-text">Valor: $0.</p>83                            <p class="card-text">Médico y sugar daddy en toda regla, llévalo y te paga la universidad</p>84                        </div>85                    </div>86                </div>87                <div class="col-12 col-sm-6 col-md-4 col-lg-3">88                    <div class="card">89                        <img src="https://areajugones.sport.es/wp-content/uploads/2020/09/hisoka-hunter-x-hunter.jpg" class="card-img-top" alt="..." />90                        <div class="card-body">91                            <h5 class="card-title">Hisoka Hijuemadre</h5>92                            <p class="card-text">Valor: $0.</p>93                            <p class="card-text">Es un Husbando pelogroso, pero a ti te gusta el peligro</p>94                        </div>95                    </div>96                </div>97            </div>98            <div className="row">99                <div class="col-12 col-sm-6 col-md-4 col-lg-3">100                    <div class="card">101                        <img src="https://studiosol-a.akamaihd.net/uploadfile/letras/fotos/7/6/5/a/765afb557fabd371fd0a3ba386728100.jpg" class="card-img-top" alt="..." />102                        <div class="card-body">103                            <h5 class="card-title">Killua Zoldyck</h5>104                            <p class="card-text">Valor: $0.</p>105                            <p class="card-text">No está a la venta we, pero mírate el anime que está weno</p>106                        </div>107                    </div>108                </div>109                <div class="col-12 col-sm-6 col-md-4 col-lg-3">110                    <div class="card">111                        <img src="https://pm1.narvii.com/6339/4561c888660d8f0cb804ce8d01bd125e4d26a22b_hq.jpg" class="card-img-top" alt="..." />112                        <div class="card-body">113                            <h5 class="card-title">Gon Freecss</h5>114                            <p class="card-text">Valor: $0.</p>115                            <p class="card-text">Da buenos cabezasos, ideal para abrir candados y otras cosas</p>116                        </div>117                    </div>118                </div>119                <div class="col-12 col-sm-6 col-md-4 col-lg-3">120                    <div class="card">121                        <img src="https://www.radiodemente.cl/wp-content/uploads/2020/04/Leorio.jpg" class="card-img-top" alt="..." />122                        <div class="card-body">123                            <h5 class="card-title">Leorio Dono</h5>124                            <p class="card-text">Valor: $0.</p>125                            <p class="card-text">Médico y sugar daddy en toda regla, llévalo y te paga la universidad</p>126                        </div>127                    </div>128                </div>129                <div class="col-12 col-sm-6 col-md-4 col-lg-3">130                    <div class="card">131                        <img src="https://areajugones.sport.es/wp-content/uploads/2020/09/hisoka-hunter-x-hunter.jpg" class="card-img-top" alt="..." />132                        <div class="card-body">133                            <h5 class="card-title">Hisoka Hijuemadre</h5>134                            <p class="card-text">Valor: $0.</p>135                            <p class="card-text">Es un Husbando pelogroso, pero a ti te gusta el peligro</p>136                        </div>137                    </div>138                </div>139            </div>140            <div className="row">141                <div class="col-12 col-sm-6 col-md-4 col-lg-3">142                    <div class="card">143                        <img src="https://studiosol-a.akamaihd.net/uploadfile/letras/fotos/7/6/5/a/765afb557fabd371fd0a3ba386728100.jpg" class="card-img-top" alt="..." />144                        <div class="card-body">145                            <h5 class="card-title">Killua Zoldyck</h5>146                            <p class="card-text">Valor: $0.</p>147                            <p class="card-text">No está a la venta we, pero mírate el anime que está weno</p>148                        </div>149                    </div>150                </div>151                <div class="col-12 col-sm-6 col-md-4 col-lg-3">152                    <div class="card">153                        <img src="https://pm1.narvii.com/6339/4561c888660d8f0cb804ce8d01bd125e4d26a22b_hq.jpg" class="card-img-top" alt="..." />154                        <div class="card-body">155                            <h5 class="card-title">Gon Freecss</h5>156                            <p class="card-text">Valor: $0.</p>157                            <p class="card-text">Da buenos cabezasos, ideal para abrir candados y otras cosas</p>158                        </div>159                    </div>160                </div>161                <div class="col-12 col-sm-6 col-md-4 col-lg-3">162                    <div class="card">163                        <img src="https://www.radiodemente.cl/wp-content/uploads/2020/04/Leorio.jpg" class="card-img-top" alt="..." />164                        <div class="card-body">165                            <h5 class="card-title">Leorio Dono</h5>166                            <p class="card-text">Valor: $0.</p>167                            <p class="card-text">Médico y sugar daddy en toda regla, llévalo y te paga la universidad</p>168                        </div>169                    </div>170                </div>171                <div class="col-12 col-sm-6 col-md-4 col-lg-3">172                    <div class="card">173                        <img src="https://areajugones.sport.es/wp-content/uploads/2020/09/hisoka-hunter-x-hunter.jpg" class="card-img-top" alt="..." />174                        <div class="card-body">175                            <h5 class="card-title">Hisoka Hijuemadre</h5>176                            <p class="card-text">Valor: $0.</p>177                            <p class="card-text">Es un Husbando pelogroso, pero a ti te gusta el peligro</p>178                        </div>179                    </div>180                </div>181            </div>182            <br /><br />183            <Link to="/ProductosPage">184                 <button type="button" class="btn btn-dark">Ver Lista completa</button>185            </Link>186            <br /><br />187        </div>188    )189}...

Full Screen

Full Screen

NewProject.js

Source:NewProject.js Github

copy

Full Screen

1import React, { Component } from 'react';2import * as routes from '../../Constants/Routes';3import './NewProject.css';4import { createProject } from '../../Constants/project';5import { numeroVal, cantidadPalabrasVal, nombresVal, rangoCaracteresVal, urlImagenVal, puntoDecimalVal } from '../../Constants/validations'6import fire from '../../Firebase/Fire'7import axios from 'axios'8import { storage } from 'firebase';9const AddProject = () =>10    <div id="project">11        <div id="main-title">Add Project</div>12        <NewProject />13    </div>1415const INITIAL_STATE = {16    titulo: '',17    descripcion: '',18    ubicacion: '',19    familiasB: '',20    tiposCultivo: '',21    infoZona: '',22    fotoF: '',23    fotoC: '',24    inversion: '',2526    //Por mientras27}2829const byPropKey = (propertyName, value) => () => ({30    [propertyName]: value,31});32333435class NewProject extends Component {3637    constructor(props) {38        super(props);39        this.state = { INITIAL_STATE, listImgCrop: [], URL: "" };40        this.fotoT = React.createRef();41        this.addListImgCrop = this.addListImgCrop.bind(this);42        this.onClick = this.onClick.bind(this);43        this.uploadImageToStorage = this.uploadImageToStorage.bind(this);44        this.handleDeleteImageCrop = this.handleDeleteImageCrop.bind(this);45        //        this.fileUploadCultivoHandler = this.fileUploadCultivoHandler.bind(this);46        //        this.fileUploadFamiliaHandler = this.fileUploadCultivoHandler.bind(this);4748    }49    /**50     *    fileUploadCultivoHandler = () => {51            const fd = new FormData();52            console.log(this.fotoC.current.files[0]);53            fd.append('image', this.fotoC.current.files[0], this.fotoC.current.files[0].name);54            axios.post('https://us-central1-spg-project-1.cloudfunctions.net/uploadFile', fd)55                .then(res => {56                    console.log(res);57                    console.log(this.fotoC)58                });59        }60        fileUploadFamiliaHandler = () => {61            const fd = new FormData();62            console.log(this.fotoF.current.files[0]);63            fd.append('image', this.fotoF.current.files[0], this.fotoF.current.files[0].name);64            axios.post('https://us-central1-spg-project-1.cloudfunctions.net/uploadFile', fd)65                .then(res => {66                    console.log(this.fotoF)67                    console.log(res);68                });69        }                                                                                                                                                                                                                                                                                                                                           70     71     * 72     * 73     */74    //En esta funcion se agregan las fotos del terreno    75    async addListImgCrop() {76        //Se crea un arreglo temporal para evaluar si la imagen ya esta agregada77        let listTemp = [];78        await this.state.listImgCrop.map(img => listTemp.push(img.name));79        //Si es undefined debe tirar una alerta80        console.log(this.fotoT.current.files[0])81        if (this.fotoT.current.files[0] != undefined) {82            if (!listTemp.includes(this.fotoT.current.files[0].name)) {83                await this.setState(state => {84                    const listImgCrop = state.listImgCrop.concat(this.fotoT.current.files[0]);85                    return {86                        listImgCrop,87                    }88                });89            } else {90                window.alert("La imagen ya existe en la coleccion");9192            }93        } else {94            window.alert("No se ha seleccionado ninguna imagen");9596        }9798        //Resetea el valor del archivo99        document.getElementById("newProject-input9").value = "";100    }101102    uploadImageToStorage = () => {103        this.state.listImgCrop.forEach(fileImg => {104            let fd = new FormData();105            fd.append('image', fileImg, fileImg.name);106            axios.post('https://us-central1-spg-project-1.cloudfunctions.net/uploadFile', fd)107                .then(res => {108                    console.log(fileImg)109                });110        });111112        this.setState(({113            listImgCrop: []114        }));115    }116117    handleDeleteImageCrop = (index, event) => {118        console.log(`Click on list ${index}`)119        event.preventDefault();120121        this.setState(state => {122            const listImgCrop = this.state.listImgCrop;123            listImgCrop.splice(index, 1);124            return (125                listImgCrop126            )127        })128    }129130    //Codigo para subir a la Storage///////////////////131    /**132         *133         * var storage = fire.storage();134        var starsRef = storage.ref().child("Giger2.jpg");135        let getURL;136        await starsRef.getDownloadURL().then(function (url) {137            console.log(url);138            getURL = url;139        })140        await this.setState(state => {141            const URL = getURL;142            return { URL }143        })144        console.log(this.state.URL); 145         * 146         */147    ///////////////////////////////////////////////////////148    async onClick(project) {149150        //Agrega en la base de datos los nombres de las imagenes//151        let nameImgRef = [];152        await this.state.listImgCrop.forEach(img => {153            console.log(img.name);154            nameImgRef.push(img.name);155        });156        /////////////////////////////////////////////////157        await createProject(this.state.titulo, 0, 0, 0, nameImgRef, null, null158            , fire.firestore.GeoPoint(10 , 10), "", "", "", "", "", "", "", "");159160        await this.uploadImageToStorage();161        window.alert(`Se ha agregegado el proyecto ${this.state.titulo}`);162163        this.setState({164            titulo: '',165            descripcion: '',166            ubicacion: '',167            familiasB: '',168            tiposCultivo: '',169            infoZona: '',170            inversion: '',171172        })173174        project.preventDefault();175    }176177    render() {178        const {179            titulo,180            descripcion,181            ubicacion,182            familiasB,183            tiposCultivo,184            infoZona,185            fotoF,186            fotoC,187            fotoT,188            inversion,189        } = this.state;190        191192        return (193194            <div onSubmit={this.onSubmit}>195196                <ul id="all-inputs">197                    <li id="all-inputs-item">198                        <input id="newProject-input1"199                            value={titulo}200                            onChange={project => this.setState(byPropKey('titulo', project.target.value))}201                            type="text"202                            placeholder="titulo"203                        />204                    </li>205206                    <li id="all-inputs-item">207                        <p>Fotos del terreno</p>208                        <input id="newProject-input9"209                            value={fotoT}210                            ref={this.fotoT}211                            type="file"212213                        />214                        <button id="bt-uploadProject" className="w3-button w3-round-xxlarge" onClick={this.addListImgCrop}>Agregar Foto</button>215                        <div>216                            { /**Muestra las imagenes que se han agregado en una lista217                            //Permite que se borren por medio del boton*/}218                            <ul>219                                {this.state.listImgCrop.map((img, index) =>220                                    <li key={index} >{img.name}221                                        <button onClick={(e) => this.handleDeleteImageCrop(index, e)}>X</button>222                                    </li>)}223                            </ul>224225                        </div>226                    </li>227                </ul>228229                <button id="bt-addProject" className="w3-button w3-round-xxlarge" onClick={this.onClick}>Add Project</button>230231            </div>232233        );234    }235}236
...

Full Screen

Full Screen

Recientes.js

Source:Recientes.js Github

copy

Full Screen

1import React, { Component } from 'react';2import InfoCancionSelect from './partes/InfoCancionSelect';3import '../asserts/css/listaCanciones.css'4import Cancion from './partes/Cancion';5import Reproductor from './partes/Reproductor';6import BarraBuscar from "./partes/BarraBuscar";7import axios from 'axios';8import { urlServidor } from './extras/variables';9export default class Recientes extends Component {10    state = {};11    constructor(props) {12        super(props);13        this.state = {14            lista_canciones: [15                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },16                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },17                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },18                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },19                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },20                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },21                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },22                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },23                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },24                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },25                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },26                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },27                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },28                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },29                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },30                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },31                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },32                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },33                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },34                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },35                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },36                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },37                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },38                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },39                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },40                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },41                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },42                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },43                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },44                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },45                { titulo: "21", artista: "Adele", img: "https://images-na.ssl-images-amazon.com/images/I/61lMwNQGYbL._SY450_.jpg" },46                { titulo: "Who You Are", artista: "Jessie J", img: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/7/a/c/8/23011.jpg" },47            ],48        };49    }50    buscarCanciones = () => {51        console.log("Entro");52        /*axios.get(urlServidor + 'search?q=eminem').then((response) => {53            console.log(response);54        })55        .catch((error) => {56            console.log("Error al buscar cancione");57        });*/58        var axios = require('axios');59        var config = {60            method: 'get',61            url: 'https://api.deezer.com/search?q=eminem',62        };63        axios(config)64            .then(function (response) {65                console.log(JSON.stringify(response.data));66            })67            .catch(function (error) {68                console.log(error);69            });70    }71    render() {72        return (73            <div>74                <BarraBuscar buscarCanciones={this.buscarCanciones} />75                {/*this.state.lista_canciones.length > 0 &&*/76                    <InfoCancionSelect />77                }78                <div className="tit_ListaCanciones">Resultados</div>79                <div className="listaCanciones">80                    {81                        this.state.lista_canciones.map((cancion, index) => {82                            return (83                                <Cancion84                                    key={index}85                                    cancion={cancion}86                                />87                            )88                        })89                    }90                </div>91                <Reproductor />92            </div>93        )94    }...

Full Screen

Full Screen

main.js

Source:main.js Github

copy

Full Screen

1import Vue from "vue";2import App from "./App.vue";3import router from "./router";4import store from "./store";5import "@/util/axios";6import "@/util/comp.js";7import Grag from "@/util/drag.js";8import Chint from "@/util/chint.js";9import "@/assets/css/common.less";10import "@/assets/css/animation.less";11import "./util/permission";12import ColorPicker from "@/components/ColorPicker/index.vue";13Vue.component("ColorPicker", ColorPicker);14import ElementUI from "@/element-ui/src/index.js";15Vue.use(ElementUI);16Vue.prototype.$drag = new Grag();17Vue.prototype.$chint = new Chint(Vue.prototype.$drag);18window.config = {};19if (window.location.host.indexOf(":18088") !== -1) {20  window.config = {21    requestUrl: "https://dev-gateway.chintcloud.net/common/api/v2.0/visual",22    dataCenterUrl: "https://dev-gateway.chintcloud.net/common/api/v2.0/visual",23    uploadUrl: "http://ufs.cloud.techsel.net/uploadfile",24    bulk: "https://dev-gateway.chintcloud.net/common/api/v2.0/visual",25    timerUrl: "https://dev-gateway.chintcloud.net/common/api/v2.0/visual",26    agreement: "http://",27    uploadJsPreUrl:28      "https://chintcloud.oss-cn-shanghai.aliyuncs.com/dev/cloud-config/js/"29  };30  // window.config = {31  //   requestUrl: "http://cloudconfigserver.cloud.techsel.net",32  //   dataCenterUrl: "http://configcenterapi.cloud.techsel.net",33  //   uploadUrl: "http://ufs.cloud.techsel.net/uploadfile",34  //   bulk: "http://dataapi.cloud.techsel.net",35  //   timerUrl: "http://hangfire.cloud.techsel.net",36  // agreement: "http://",37  // uploadJsPreUrl:"https://chintcloud.oss-cn-shanghai.aliyuncs.com/dev/cloud-config/js/"38  // };39} else if (window.location.host.indexOf("dev-zt") !== -1) {40  window.config = {41    requestUrl: "https://dev-gateway.chintcloud.net/common/api/v2.0/visual",42    dataCenterUrl: "https://dev-gateway.chintcloud.net/common/api/v2.0/visual",43    uploadUrl: "http://ufs.cloud.techsel.net/uploadfile",44    bulk: "https://dev-gateway.chintcloud.net/common/api/v2.0/visual",45    timerUrl: "https://dev-gateway.chintcloud.net/common/api/v2.0/visual",46    agreement: "http://",47    uploadJsPreUrl:48      "https://chintcloud.oss-cn-shanghai.aliyuncs.com/dev/cloud-config/js/"49  };50} else if (window.location.host.indexOf("test-zt") !== -1) {51  window.config = {52    requestUrl: "https://test-gateway.chintcloud.net/common/api/v2.0/visual",53    dataCenterUrl: "https://test-gateway.chintcloud.net/common/api/v2.0/visual",54    uploadUrl: "http://ufs.cloud.techsel.net/uploadfile",55    bulk: "https://test-gateway.chintcloud.net/common/api/v2.0/visual",56    timerUrl: "https://test-gateway.chintcloud.net/common/api/v2.0/visual",57    agreement: "https://",58    uploadJsPreUrl:59      "https://chintcloud.oss-cn-shanghai.aliyuncs.com/test/cloud-config/js/"60  };61  // window.config = {62  //   requestUrl: "https://test-gateway.chintcloud.net/common/api/v2.0/visual",63  //   dataCenterUrl: "https://test-gateway.chintcloud.net/common/api/v2.0/visual",64  //   uploadUrl: "http://ufs.cloud.techsel.net/uploadfile",65  //   bulk: "http://dataapi.cloud.techsel.net",66  //   timerUrl: "http://hangfire.cloud.techsel.net",67  // agreement: "https://",68  // uploadJsPreUrl:"https://chintcloud.oss-cn-shanghai.aliyuncs.com/dev/cloud-config/js/"69  // };70} else if (window.location.host.indexOf(".zt.chint.com") !== -1) {71  window.config = {72    requestUrl: "https://gateway.chint.com/common/api/v2.0/visual",73    dataCenterUrl: "https://gateway.chint.com/common/api/v2.0/visual",74    uploadUrl: "http://ufs.cloud.techsel.net/uploadfile",75    bulk: "https://gateway.chint.com/common/api/v2.0/visual",76    timerUrl: "https://gateway.chint.com/common/api/v2.0/visual",77    agreement: "https://",78    uploadJsPreUrl:79      "https://chintcloud.oss-cn-shanghai.aliyuncs.com/prd/cloud-config/js/"80  };81  // window.config = {82  //   requestUrl: "http://gateway.chint.com/common/api/v2.0/visual",83  //   dataCenterUrl: "http://gateway.chint.com/common/api/v2.0/visual",84  //   uploadUrl: "http://ufs.cloud.techsel.net/uploadfile",85  //   bulk: "http://dataapi.cloud.techsel.net",86  //   timerUrl: "http://hangfire.cloud.techsel.net",87  // agreement: "https://",88  // uploadJsPreUrl:"https://chintcloud.oss-cn-shanghai.aliyuncs.com/dev/cloud-config/js/"89  // };90}91Vue.config.productionTip = false;92new Vue({93  router,94  store,95  render: h => h(App)96}).$mount("#app");97/**98 * 屏蔽浏览器的缩放事件99 */100window.addEventListener(101  "mousewheel",102  function(event) {103    if (event.ctrlKey || event.metaKey) {104      event.preventDefault();105    }106  },107  { passive: false }108);109// window.addEventListener(110//   "contextmenu",111//   function(e) {112//     Vue.prototype.$drag.hideContextmenu();113//     e.preventDefault();114//   },115//   false...

Full Screen

Full Screen

Artista.js

Source:Artista.js Github

copy

Full Screen

1import * as React from 'react';2import { View, Text, StyleSheet, ImageBackground, FlatList, Image, ScrollView, TouchableOpacity} from 'react-native';3import {MaterialCommunityIcons} from '@expo/vector-icons';4export default function Artista(props) {5  return (6    <View style={estilo.container}>7      <ImageBackground8        style={estilo.fundoimg}9        resizeMode="cover"10        source={require('../../assets/bg-artistas.png')}>11        12        <ScrollView style={[estilo.scrollview]}>13            14        15        <Text style={estilo.titulo}><MaterialCommunityIcons name="star" size="40" color="white" /> Melhores Artistas</Text>16        <FlatList 17        data={artistas}18        renderItem={({item})=>19        <View style={estilo.artista}>20         21          <View style={estilo.centro}>22            <TouchableOpacity onPress={()=>{props.navigation.navigate(item.buttom)}}>23              <Text style={estilo.txtArtista}>{item.nome}</Text>24              <Image style={estilo.img} source={{uri:item.imagem}}/>25              </TouchableOpacity>26          </View>27          28          <View style={estilo.rede}>29          30            <Text style={estilo.curtidas}>31            <MaterialCommunityIcons name="thumb-up" size="25" color="#00aeff" /> {item.like} {"\n"}Curtidas32            </Text>33            <Text style={estilo.seguidores}>34            <MaterialCommunityIcons name="heart" size="25" color="#fa285f" /> {item.seguidores} {"\n"}Seguidores</Text>35          </View>36        </View>37      38        }39        />   40        </ScrollView>   41      </ImageBackground>42    </View>43  );44}45const artistas = [46  {47    uid:1,48    nome: 'Post Malone',49    like: '1,2B',50    imagem: 'https://studiosol-a.akamaihd.net/uploadfile/letras/fotos/f/b/e/1/fbe18cd280210357f346b9b08bb78640.jpg',51    seguidores: '826M', 52    buttom: 'PostMalone'53  },54  {55    uid:2,56    nome: 'Travis Scott',57    like: '746M',58    imagem: 'https://studiosol-a.akamaihd.net/uploadfile/letras/fotos/6/2/b/0/62b02da019ef29b6f3621ed2912449ca.jpg',59    seguidores: '263M', 60    buttom: 'TravisScott'61  },62  {63    uid:3,64    nome: 'Lil Nas X',65    like: '800M',66    imagem: 'https://observatoriog.bol.uol.com.br/wordpress/wp-content/uploads/2020/01/LilNasX.jpg',67    seguidores: '286M',68    buttom: 'LilNasX' 69  },70  {71    uid:5,72    nome: 'Billie Eilish',73    like: '684M',74    imagem: 'https://media.vanityfair.com/photos/5f05db06f519da95a3b4164f/2:3/w_824,h_1236,c_limit/billie-eilish.jpg',75    seguidores: '290M', 76    buttom: 'BillieEilish'77  },78  {79    uid:5,80    nome: 'Drake',81    like: '786M',82    imagem: 'https://images.impresa.pt/blitz/2021-09-03-Drake.jpg-5cd1d869/original',83    seguidores: '310M', 84    buttom: 'Drake'85  },86  {87    uid:6,88    nome: 'Eminem',89    like: '977M',90    imagem: 'https://www.tenhomaisdiscosqueamigos.com/wp-content/uploads/2020/02/eminem-rapper-2019.jpg',91    seguidores: '296M', 92    buttom: 'Eminem'93  },94]95const estilo = StyleSheet.create({96  container: {97    flex: 1,98  },99  titulo: {100    textAlign: 'center',101    fontSize: 26,102    fontWeight: 800,103    fontWeight: 'bold',104    color: '#FFFFFF',105    marginTop: 30,106    marginBottom: 30,107  },108  fundoimg: {109    position: "absolute",110    top: 0,111    left: 0,112    right: 0,113    bottom: 0114  },115  artista: {116    marginEnd: 40,117    marginStart: 40,118    marginBottom: 35,119    justifyContent: 'center',120    backgroundColor: 'rgba(56, 56, 65, 0.81)',121    padding: 10,122    borderRadius: 10,123    alignContent: 'center',124    textAlign: 'center',125    shadowColor: '#00FFFF',126    shadowRadius: 25,127    borderColor: '#00FFFF',128    borderWidth: 2          129  },130  txtArtista:{131    fontSize: 25,132    fontWeight: 700,133    fontWeight: 'bold',134    color: '#00FFFF'135  },136  curtidas:{137    fontWeight: 400,138    color: '#FFFFFF'139  },140  seguidores:{141    fontWeight: 400,142    color: '#FFFFFF'143  },144  rede:{145    flexDirection: 'row',146    justifyContent: 'space-around',147    marginTop: 5148  },149  150  img:{151  margin: 10,152  width: 120,153  height: 120,154  borderRadius: 100,155  borderColor: '#CFFFFF',156  borderWidth: 4157  },158  centro:{159    justifyContent: "center",160    alignItems: "center",161  },162  scrollview: {163   backgroundColor: 'transparent'164  }...

Full Screen

Full Screen

script.js

Source:script.js Github

copy

Full Screen

1const music = new Audio('music/mostgirl.mp3');2// create Array3const songs = [4    {5        id: '1',6        songName: `Most Girls <br> 7        <div class="subtitle">Haille Stenfield</div>`,8        poster: "https://lastfm.freetls.fastly.net/i/u/ar0/2c88a4bae0d18e7b638d9c94b6f3cbd8"9    },10    11    {12        id: '2',13        songName: `Bad Habits <br> 14        <div class="subtitle">Ed Sheeran</div>`,15        poster: "https://upload.wikimedia.org/wikipedia/pt/c/c1/Bad_Habits_-_Ed_Sheeran.png"16    },17    {18        id: '3',19        songName: `Toxic <br> 20        <div class="subtitle">Britney Spears</div>`,21        poster: "https://i.ytimg.com/vi/B6qBrZ81LlQ/mqdefault.jpg"22    },23    {24        id: '4',25        songName: `kato & sigala feat. hailee steinfeld <br> 26        <div class="subtitle">KATO Music</div>`,27        poster: "https://i.discogs.com/PI-IfaPtB85QiCaL9nAS-oTxVN-aDr2BZ7kxNrFLRgE/rs:fit/g:sm/q:90/h:399/w:600/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9BLTM5MzY5/NzUtMTU5NjQ2NDg1/Ni02NDkxLmpwZWc.jpeg"28    },29    {30        id: '5',31        songName: `Me Too <br> 32        <div class="subtitle">Meghan Trainor</div>`,33        poster: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/a/c/6/3/494291460741869.jpg"34    },35    {36        id: '6',37        songName: `Heaven <br> 38        <div class="subtitle">Julia Michaels</div>`,39        poster: "https://lastfm.freetls.fastly.net/i/u/ar0/c6bf7adc16e6d1a244b69e10ae22f6e7.jpg"40    },41  42    {43        id: '11',44        songName: `Heat waves <br> 45        <div class="subtitle">glass animals</div>`,46        poster: "https://m.media-amazon.com/images/I/514dqTp4bcS._AC_SY450_.jpg"47    },48    {49        id: '12',50        songName: `The Kid LAROI<br> 51        <div class="subtitle">Justin Bieber Stay</div>`,52        poster: "https://upload.wikimedia.org/wikipedia/pt/0/07/Stay_-_The_Kid_Laroi_e_Justin_Bieber.png"53    },54    {55        id: '13',56        songName: `Watermelon Sugar<br> 57        <div class="subtitle">Harry Styles. </div>`,58        poster: "https://br.jetss.com/wp-content/uploads/2019/11/73401834_472438170033612_3921474701504190027_n.jpg"59    },60    {61        id: '14',62        songName: `Easy On Me. <br> 63        <div class="subtitle">Adele</div>`,64        poster: "https://esheetmusics.com/wp-content/uploads/2021/10/adele-easy-on-me-piano-violin-cover.jpg"65    },66    {67        id: '15',68        songName: `Beggin  <br> 69        <div class="subtitle">MÃ¥neskin</div>`,70        poster: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/4/4/1/f/934271595948653.jpg"71    },72    {73        id: '16',74        songName: `Cold Heart <br> 75        <div class="subtitle">Elton John, Dua Lipa</div>`,76        poster: "https://m.extra.globo.com/incoming/25218745-7d1-b04/w367h550-PROP/my-universe.jpg"77    },78    {79        id: '17',80        songName: `My Universe <br> 81        <div class="subtitle">Coldplay X BTS</div>`,82        poster: "https://m.media-amazon.com/images/I/514dqTp4bcS._AC_SY450_.jpg"83    },84    {85        id: '18',86        songName: ` Leave the Door Open <br> 87        <div class="subtitle">Bruno Mars, Anderson .Paak, Silk Sonic.</div>`,88        poster: "https://i.scdn.co/image/ab67616d0000b2730d18a58b311b58820ba4735f"89    },90    {91        id: '19',92        songName: `Abcdefu <br> 93        <div class="subtitle">Gayle</div>`,94        poster: "https://upload.wikimedia.org/wikipedia/pt/thumb/d/d0/ABCDEFU_-_Gayle.png/220px-ABCDEFU_-_Gayle.png"95    },96    {97        id: '20',98        songName: `Shivers <br> 99        <div class="subtitle">Ed Sheeran</div>`,100        poster: "https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/9/6/6/0/1150231631621832.jpg"101    },102  103]104Array.from(document.getElementsByClassName('songItem')).forEach((element, i)=>{105    element.getElementsByTagName('img') [0].src = songs[i].poster;106    element.getElementsByTagName('h5') [0].innerHTML = songs[i].songName;107    ...

Full Screen

Full Screen

SideBar.js

Source:SideBar.js Github

copy

Full Screen

1import React from 'react'2import Channel from './Channel'3import './SideBar.css'4const SideBar = () => {5    return (6        <div className="sidebar">7            <div className="sidebar__top" >8                <h5>FOLLOWED CHANNELS</h5>9                <Channel10                    avatar="https://vignette.wikia.nocookie.net/heroess/images/2/2d/TSR_Sonic.png/revision/latest/scale-to-width-down/310?cb=20190524005513&path-prefix=es"11                    name="Conic"12                    followers="549K" />13                <Channel14                    avatar="https://vignette.wikia.nocookie.net/heroess/images/d/dd/SRivals_Sonic_con_Silver.png/revision/latest/scale-to-width-down/184?cb=20190525000920&path-prefix=es"15                    name="ponic"16                    followers="549K" />17                <Channel18                    avatar="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSMDJNNV6E6cIQiS2p7huMyxcpSvTYzC8LkZw&usqp=CAU"19                    name="Master"20                    followers="55K" />21                <Channel22                    avatar="https://studiosol-a.akamaihd.net/uploadfile/cifraclub/avatar/9/4/4dcb5yex1zr.jpg"23                    name="Jorge"24                    followers="52K" />25                <h5>RECOMMENT CHANNELS</h5>26                <Channel27                    avatar="https://www.bikemontt.com/foro/uploads/monthly_2017_07/C.png.aa86a8e7871be6f0d4a1bc21b93e6077.png"28                    name="Katarine"29                    followers="22K" />30                <Channel31                    avatar="https://studiosol-a.akamaihd.net/uploadfile/cifraclub/avatar/0/1/48kfe1z4sqw.jpg"32                    name="Alberto"33                    followers="525K" />34                <Channel35                    avatar="https://studiosol-a.akamaihd.net/uploadfile/cifraclub/avatar/4/0/49lwpkicfq9.jpg"36                    name="Becerro"37                    followers="16K" />38                <Channel39                    avatar="https://studiosol-a.akamaihd.net/uploadfile/cifraclub/avatar/2/8/476jeq7xmua.jpg"40                    name="Norma"41                    followers="16K" />42                <p className="sidebar__topShowMore">Show More</p>43            </div>44            <div className="sidebar__bottom">45                <div className="sidebar__bottomContainer" >46                    <i className="fas fa-search" ></i>47                    <input type="text" placeholder="Search to Add Friend's"/>48                </div>49            </div>50        </div>51    )52}...

Full Screen

Full Screen

songs.js

Source:songs.js Github

copy

Full Screen

1const estiloCachorro = require('../../static/songs/Estilo cachorro - Racionais Mcs.mp3');2const semMedoDaEscuridao = require('../../static/songs/Sem-Medo-da-Escuridão-Charlie-Brown Jr.mp3');3const snoopSong1 = require('../../static/songs/snoop doggy dogg.mp3');4const snoopSong2 = require('../../static/songs/Snoop Dogg-Gin And Juice.mp3');5const hotOreiaSong = require('../../static/songs/Eu Vou.mp3');6const djongaSong = require('../../static/songs/3 . Djonga - UFA.mp3');7export const racionaisMC = [8  {9    id: 1,10    name: 'Estilo Cachorro',11    artists: ['Racionais Mc'],12    image:13      'https://upload.wikimedia.org/wikipedia/pt/6/62/Nada_como_um_dia_após_o_outro_dia.jpg',14    url: estiloCachorro,15    liked: true,16  },17];18export const charlieBrownJr = [19  {20    id: 2,21    name: 'Sem Medo da Escuridão',22    artists: ['Charlie Brown Jr', 'MV Bill'],23    image:24      'https://http2.mlstatic.com/charlie-brown-jr-ritmo-ritual-e-responsa-cd-D_NQ_NP_951411-MLB28023955664_082018-O.jpg',25    url: semMedoDaEscuridao,26    liked: false,27  },28];29export const snoopDogg = [30  {31    id: 3,32    name: 'Who Am I',33    artists: ['Snoop Dogg'],34    image:35      'https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/3/e/4/a/22340.jpg',36    url: snoopSong1,37    liked: true,38  },39  {40    id: 4,41    name: 'Gin And Juice',42    artists: ['Snoop Dogg'],43    image:44      'https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/3/e/4/a/22340.jpg',45    url: snoopSong2,46    liked: false,47  },48];49export const hotOreia = [50  {51    id: 5,52    name: 'Eu Vou',53    artists: ['Hot e Oreia', 'Djonga'],54    image:55      'https://images.genius.com/328b47ccd1d46c351f1c937a276ecfc1.761x761x1.jpg',56    url: hotOreiaSong,57    liked: true,58  },59];60export const djonga = [61  {62    id: 6,63    name: 'UFA',64    artists: ['Djonga', 'Sidoka', 'Sant'],65    image:66      'https://studiosol-a.akamaihd.net/uploadfile/letras/albuns/e/e/9/1/628451521047499.jpg',67    url: djongaSong,68    liked: true,69  },...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var net = require('net');2net.uploadFile('path/to/local/file', 'path/to/remote/file');3var net = require('net');4net.downloadFile('path/to/remote/file', 'path/to/local/file');5var net = require('net');6net.downloadFile('path/to/remote/file', 'path/to/local/file');7var net = require('net');8net.downloadFile('path/to/remote/file', 'path/to/local/file');9var net = require('net');10net.downloadFile('path/to/remote/file', 'path/to/local/file');11var net = require('net');12net.downloadFile('path/to/remote/file', 'path/to/local/file');13var net = require('net');14net.downloadFile('path/to/remote/file', 'path/to/local/file');15var net = require('net');16net.downloadFile('path/to/remote/file', 'path/to/local/file');17var net = require('net');18net.downloadFile('path/to/remote/file', 'path/to/local/file');19var net = require('net');20net.downloadFile('path/to/remote/file', 'path/to/local/file');21var net = require('net');22net.downloadFile('path/to/remote/file', 'path/to/local/file');23var net = require('net');24net.downloadFile('path/to/remote/file', 'path/to/local/file');

Full Screen

Using AI Code Generation

copy

Full Screen

1var driver = require('appium').remote({2  desiredCapabilities: {3  }4});5driver.init();6  .sendKeys('some text');7  .click()8  .sleep(3000);9  .uploadFile('path to the file to be uploaded')10  .then(function (res) {11    console.log('file uploaded to ' + res);12  });13  .quit();14var driver = require('appium').remote({15  desiredCapabilities: {16  }17});18driver.init();19  .sendKeys('some text');20  .click()21  .sleep(3000);22  .downloadFile('path to the file to be downloaded')23  .then(function (res) {24    console.log('file downloaded to ' + res);25  });26  .quit();27var driver = require('appium').remote({28  desiredCapabilities: {

Full Screen

Using AI Code Generation

copy

Full Screen

1var wd = require("wd");2var assert = require('assert');3var path = require('path');4var desired = {5};6var driver = wd.promiseChainRemote("localhost", 4723);7    .init(desired)8    .then(function () {9        return driver.elementById('io.appium.android.apis:id/edit');10    })11    .then(function (el) {12        return el.click();13    })14    .then(function () {15        return driver.elementById('io.appium.android.apis:id/edit');16    })17    .then(function (el) {18        return el.sendKeys('Hello World');19    })20    .then(function () {21        return driver.elementById('io.appium.android.apis:id/edit');22    })23    .then(function (el) {24        return el.text();25    })26    .then(function (text) {27        assert.equal(text, 'Hello World');28    })29    .then(function () {30        return driver.pushFile('/sdcard/test.txt', 'test file');31    })32    .then(function () {33        return driver.quit();34    })35    .done();

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 Appium Android Driver 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