Skip to content

Instantly share code, notes, and snippets.

View aevans-mms's full-sized avatar

Aaron Evans aevans-mms

  • MMS
View GitHub Profile
package org.mms.qa.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.GetObjectRequest;
import software.amazon.awssdk.services.s3.model.ListObjectsV2Request;
import software.amazon.awssdk.services.s3.model.S3Object;
@aevans-mms
aevans-mms / DynamoDB.ts
Created October 9, 2024 13:50
AWS DynamoDB TypeScript Commands Wrapper and Simple Class
import * as dynamodb from "@aws-sdk/client-dynamodb"
const commands = {
"client" : (params:dynamodb.DynamoDBClientConfig) => new dynamodb.DynamoDBClient(params),
"listTables" : (params:dynamodb.ListTablesCommandInput) => new dynamodb.ListTablesCommand(params),
"describeTable" : (params:dynamodb.DescribeTableCommandInput)=>new dynamodb.DescribeTableCommand(params),
"query" : (params:dynamodb.QueryCommandInput) => new dynamodb.QueryCommand(params),
"scan" : (params:dynamodb.ScanCommandInput) => new dynamodb.ScanCommand(params),
"getItem" : (params:dynamodb.GetItemCommandInput) => new dynamodb.GetItemCommand(params),
"putItem" : (params:dynamodb.PutItemCommandInput) => new dynamodb.PutItemCommand(params),
@aevans-mms
aevans-mms / AgeVerificationTests.java
Last active February 16, 2024 18:58
Comparing different assertion methods and error messages
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
class Customer
{
@aevans-mms
aevans-mms / Main.java
Last active January 19, 2024 21:58
Hello Selenium
package org.example;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Main {
public static void main(String[] args) {
WebDriver driver = new ChromeDriver();
driver.get("https://www.nejm.org/");
Feature: NEJM Registration
Scenario: Register as Physician
Given I am a physician
When I register for NEJM
And I enter my email address on the registration form and click continue
And I select my country on the registration form and click continue
Then I should see the "Professional Category" field on the registration form
// parse_options.js
function parse_options(locator) {
let options = [];
document.querySelectorAll(locator).forEach(option => {
console.log(option);
const value = option.getAttribute("value");
const text = option.text;
const key = text
@aevans-mms
aevans-mms / user.java
Last active August 18, 2023 14:48
User Entity and Builder examples
package ucc.models;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.javafaker.Faker;
import io.restassured.response.Response;
import org.mms.qa.EmailBuilder;
import org.testng.annotations.Test;
import ucc.api.exp.myaccount.MyAccountApi;
import speech_recognition as sr
import pyttsx3
# initialize the speech recongnition and text-to-speech enginers
r = sr.Recognizer()
engine = pyttsx3.init()
# define a function to speak the text
def speak(text):
engine.say(text)
package org.mms;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.edge.EdgeOptions;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.remote.RemoteWebDriver;