Skip to content

Instantly share code, notes, and snippets.

View kapoorlakshya's full-sized avatar
🙃

Lakshya Kapoor kapoorlakshya

🙃
View GitHub Profile
@kapoorlakshya
kapoorlakshya / bazel_ui_test.sh
Created April 20, 2023 20:52
Local testing script to run UI tests using Bazel
set -e
export BITRISE_DEPLOY_DIR="/Users/lakshya.kapoor/src/reddit-ios"
export BITRISE_SOURCE_DIR="/Users/lakshya.kapoor/src/reddit-ios"
export BITRISE_PULL_REQUEST=29378
export REDDIT_BUILD_CONFIGURATION=Debug
export TEST_DEVICE_MODEL="com.apple.CoreSimulator.SimDeviceType.iPhone-14-Pro"
export LAUNCH_OPTIONS_JSON_PATH="/Users/lakshya.kapoor/src/reddit-ios/UITests/Resources/selected_smoke_tests.json"
export REDDIT_EXPERIMENTS_FOR_UI_SMOKE_TESTS="/Users/lakshya.kapoor/src/reddit-ios/experiments_to_test.txt"
@kapoorlakshya
kapoorlakshya / TestRailObservation.swift
Created May 13, 2022 05:25 — forked from billylam/TestRailObservation.swift
Sample for pushing XCTest/XCUITest results to TestRail
//
// TestRailObservation.swift
//
import Foundation
import XCTest
class TestRailObservation: NSObject, XCTestObservation {
// Add a user / pass or key for testrail generation
var testrailUsername: String = ""

Disable Device Enrollment Program (DEP) notification on macOS Catalina.md

With full reinstall (recommended)

   a. Boot into recovery using command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS

   b. Initial installation will run for approximately 1 hour, and reboot once

   c. It will then show a remaining time of about 10-15 minutes

@kapoorlakshya
kapoorlakshya / webdriverio-aws-device-farm-debug-log.txt
Last active February 4, 2020 00:19
webdriverio-aws-device-farm-debug-log
Execution of 1 spec files started at 2020-02-04T00:03:44.867Z
2020-02-04T00:03:44.868Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-02-04T00:03:44.871Z INFO @wdio/local-runner: Start worker 0-0 with arg: webdriver:aws
[0-0] 2020-02-04T00:03:45.147Z INFO @wdio/local-runner: Run worker command: run
[0-0] RUNNING in chrome - /specs/login/home-page.js
[0-0] 2020-02-04T00:03:45.230Z DEBUG @wdio/local-runner:utils: init remote session
[0-0] 2020-02-04T00:03:45.231Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-02-04T00:03:45.233Z INFO webdriver: [POST] https://testgrid-devicefarm.us-west-2.amazonaws.com/:443AQICAHiRxhO-<redacted-long-string>_s1KzZx_a4zfHB
2YtrdnY=/wd/hub/session
@kapoorlakshya
kapoorlakshya / jruby_debugging_cheatsheet.md
Last active June 7, 2019 23:06
Debugging in JRuby 9.2.x

Debugging in JRuby 9.2.x

  1. Add these gems in gemfile or gemspec:
gem 'ruby-debug'
gem 'columnize'
  1. Add require 'ruby-debug' in your project.
@kapoorlakshya
kapoorlakshya / selenium_click_works.log
Created May 15, 2019 00:35
selenium_click_works.log
# Logfile created on 2019-05-14 17:28:52 -0700 by logger.rb/66358
2019-05-14 17:28:52 INFO Selenium -> POST session/70d04ec224c42b68782f54664e10cef8/element
2019-05-14 17:28:52 INFO Selenium >>> http://127.0.0.1:9515/session/70d04ec224c42b68782f54664e10cef8/element | {"using":"xpath","value":".//*[local-name()='iframe'][contains(@src, 'SearchPage_Procedure')]"}
2019-05-14 17:28:53 INFO Selenium <- {"value":{"element-6066-11e4-a52e-4f735466cecf":"5035ccf6-853b-485a-95be-2acd3d7d4d82"}}
2019-05-14 17:28:53 INFO Selenium -> GET session/70d04ec224c42b68782f54664e10cef8/element/5035ccf6-853b-485a-95be-2acd3d7d4d82/css/staleness_check
2019-05-14 17:28:53 INFO Selenium <- {"value":""}
2019-05-14 17:28:53 INFO Selenium -> POST session/70d04ec224c42b68782f54664e10cef8/frame
2019-05-14 17:28:53 INFO Selenium >>> http://127.0.0.1:9515/session/70d04ec224c42b68782f54664e10cef8/frame | {"id":{"element-6066-11e4-a52e-4f735466cecf":"5035ccf6-853b-485a-95be-2acd3d7d4d82"}}
2019-05-14 17:28:53 INFO Selenium <- {"value":n
@kapoorlakshya
kapoorlakshya / selenium_click_bang_fails.log
Created May 15, 2019 00:34
selenium_click_bang_fails.log
# Logfile created on 2019-05-14 17:29:58 -0700 by logger.rb/66358
2019-05-14 17:29:58 INFO Selenium -> POST session/b91ca0b702dfa9a69b04de79ad2c1422/element
2019-05-14 17:29:58 INFO Selenium >>> http://127.0.0.1:9515/session/b91ca0b702dfa9a69b04de79ad2c1422/element | {"using":"xpath","value":".//*[local-name()='iframe'][contains(@src, 'SearchPage_Procedure')]"}
2019-05-14 17:29:59 INFO Selenium <- {"value":{"element-6066-11e4-a52e-4f735466cecf":"c63f8530-e6cd-4e7d-bfef-27e378c33a30"}}
2019-05-14 17:29:59 INFO Selenium -> POST session/b91ca0b702dfa9a69b04de79ad2c1422/frame
2019-05-14 17:29:59 INFO Selenium >>> http://127.0.0.1:9515/session/b91ca0b702dfa9a69b04de79ad2c1422/frame | {"id":{"element-6066-11e4-a52e-4f735466cecf":"c63f8530-e6cd-4e7d-bfef-27e378c33a30"}}
2019-05-14 17:29:59 INFO Selenium <- {"value":null}
2019-05-14 17:29:59 INFO Selenium -> POST session/b91ca0b702dfa9a69b04de79ad2c1422/element
2019-05-14 17:29:59 INFO Selenium >>> http://127.0.0.1:9515/session/b91ca0b702dfa9a69b04de79ad2c14
@kapoorlakshya
kapoorlakshya / Checkout BitBucket PR
Last active May 1, 2019 22:51
Checkout BitBucket PR
git remote add my_remote <git_clone_URL_of_repo>
git remote -v # Verify repo was added
git config --add remote.my_remote.fetch +refs/pull-requests/*/from:refs/remotes/my_remote/pr/* # Configure to fetch PR
git fetch qa -p # Fetch PRs and remove links to merged PRs
git branch -a # List all branches and PRs
git checkout -t my_remote/pr/45
@kapoorlakshya
kapoorlakshya / rubocop.yml
Created April 11, 2019 05:56
rubocop.yml
# Please keep AllCops, Bundler, Layout, Style, Metrics groups and then order cops
# alphabetically
#
# References:
# * https://github.com/bbatsov/ruby-style-guide
# * https://rubocop.readthedocs.io/
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
ExtraDetails: false
@kapoorlakshya
kapoorlakshya / RubyMine ConEmu + Git Bash in Terminal
Last active February 12, 2019 00:10
RubyMine ConEmu + Git Bash in Terminal
ConEmu in RubyMine
------------------
1. Create file rubymine-conemu.bat
2. Paste: cmd.exe /k "C:\Program Files\ConEmu\ConEmu\CmdInit.cmd"
3. In RubyMine > Terminal Settings > Shell Path: "C:\Program Files\ConEmu\rm-conemu.bat"
Git Bash from cmd
-----------------