Skip to content

Instantly share code, notes, and snippets.

@SarahElson
SarahElson / conftest.py
Created August 12, 2022 14:05
How To Download File Using Selenium Python?
import unittest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
class Browser(unittest.TestCase):
def setUp(self):
PATH = "/Users/macbookair/Desktop/how_download_files_selenium_python/download"
#Google Chrome
options = Options()
prefs = {"download.default_directory" : PATH}
class TestAPIDownloadFile():
username = "username"
access_Key = "access key"
#POST_REQUEST
url = "https://api.lambdatest.com/automation/api/v1/user-files"
payload={}
@SarahElson
SarahElson / conftest.py
Created August 12, 2022 14:11
How To Download File Using Selenium Python?
import unittest
from selenium import webdriver
class Browser(unittest.TestCase):
def setUp(self):
PATH = "/Users/macbookair/Desktop/how_download_files_selenium_python/download"
#Mozilla Firefox
profile = webdriver.FirefoxProfile()
profile.set_preference("browser.download.folderList", 2)
profile.set_preference("browser.download.manager.showWhenStarting", False)
profile.set_preference("browser.download.dir", PATH)
@SarahElson
SarahElson / package. json
Created August 13, 2022 03:28
How To Style And Write CSS In React
{
"name": "my-project", //name of the project
"version": "0.1.0", // version of the project
"private": true, //Public when you upload your project to npm
"dependencies": { //dependencies used in your project
"@typeform/embed": "^1.36.0",
"@typeform/embed-react": "^1.17.0",
"bootstrap": "^5.1.3",
"cra-template": "1.2.0",
"framer-motion": "^6.5.1",
@SarahElson
SarahElson / App.jsx
Created August 13, 2022 03:59
How To Style And Write CSS In React
import React from 'react';
function App() {
return (
<main style={{padding:"5px"}}>
<p style={{ fontWeight: "bold",fontFamily:"sans-serif" }}>
Elon Musk </p>
<p>18.6k Tweets</p>
<img alt=""
style={{ width: "100%" }}
src='https://pbs.twimg.com/profile_banners/44196397/1576183471/600x200'
@SarahElson
SarahElson / divStyles
Created August 13, 2022 04:08
How To Style And Write CSS In React
const Styles = {
divStyles: {
color: "red",
backgroundColor: "black",
fontSize: "20px",
fontWeight: "bold",
textAlign: "center",
padding: "1px",
margin: "10px",
},
@SarahElson
SarahElson / App.js
Created August 13, 2022 04:28
How To Style And Write CSS In React
import Styles from "./App.module.css";
export default function App() {
return (
<div className={Styles.block}>
<h2>
React is a free and open-source front-end JavaScript library for
building user interfaces based on UI components. It is maintained by
Meta and a community of individual developers and companies
</h2>
@SarahElson
SarahElson / App.module.CSS
Created August 13, 2022 04:29
How To Style And Write CSS In React
block {
display: "block";
width: 70vw;
font-family: sans-serif;
max-width: fit-content;
background-color: black;
border-radius: 5px;
color: white;
font-size: 24px;
text-align: center;
@SarahElson
SarahElson / styled jsx
Created August 13, 2022 04:43
How To Style And Write CSS In React
import "./styles.css";
export default function App() {
return (
<div className='App'>
<h1>
Hello World
<style jsx>
{`
h1 {
@SarahElson
SarahElson / App.js
Created August 13, 2022 04:51
How To Style And Write CSS In React
import "./styles.css";
import styled from "styled-components";
const Button = styled.a`
/* This renders the buttons above... Edit me! */
display: inline-block;
border-radius: 3px;
padding: 1rem;
margin: 0.5rem 1rem;
width: 11rem;