Skip to content

Instantly share code, notes, and snippets.

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
def test_simplest():
driver = webdriver.Chrome()
driver.implicitly_wait(10)
driver.get("https://todomvc.com/examples/vanillajs/")
input_field = driver.find_element(By.CLASS_NAME, "new-todo")
input_field.send_keys("Learning Selenium")
from playwright.sync_api import expect
def test_add_todo(page):
page.goto("https://todomvc.com/examples/vanillajs/")
input_field = page.get_by_placeholder("What needs to be done?")
input_field.fill("Learning Playwright")
input_field.press("Enter")
expect(page.locator(".todo-list li label")).to_have_text("Learning Playwright")
import pytest
from playwright.sync_api import Page, expect
url = "https://www.exploratorytestingacademy.com/app/"
def this_is_sample():
with open('bible.txt') as f:
lines = f.readlines()
return str(lines)
import pytest
from playwright.sync_api import Page, expect
url = "https://www.exploratorytestingacademy.com/app/"
@pytest.mark.parametrize('input_text, expect_wordcount, expect_discouraged, expect_violation',
[
("word", "1", "0", "0"),
("If programming's the act of teaching a computer to have a conversation with a user, it most useful to first teach the computer how to speak.","26","0","1"),
#bug: incorrectly recognized - should be recognized and isn't.
Feature: User management
As an administrator,
I can define users selecting roles with every role able to view observations,
So that users have access to intended information.
@todo
Scenario: User with admin rights can create users
Given User has admin rights
When User logs in to user management
Then User can create other users
Feature: User management
As an administrator,
I can define users selecting roles with every role able to view observations,
So that users have access to intended information.
Scenario: Admin can create admins
Given Default admin logs in to user management
Then Admin can create admin users
Then New admin user exists on the users list
And New admin user can login
args: (0,) => 'zero'
args: (1,) => ' one'
args: (2,) => ' two'
args: (3,) => ' three'
args: (4,) => ' four'
args: (5,) => ' five'
args: (6,) => ' six'
args: (7,) => ' seven'
args: (8,) => ' eight'
args: (9,) => ' nine'
package com.gildedrose;
import org.approvaltests.combinations.CombinationApprovals;
import org.approvaltests.legacycode.Range;
import junit.framework.TestCase;
public class GildedRoseApprovalTest extends TestCase {
public void testSomething() throws Exception {
package com.gildedrose;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class GildedRoseTest {
@Test
public void AfterSellByDateDegradeDouble() {
@maaretp
maaretp / CheckItem.java
Created August 12, 2018 06:37
CheckItem method for Gilded Rose
public GildedRose checkItem(String item, Integer sellin, Integer quality) {
Item[] items = new Item[] { new Item(item, sellin, quality) };
GildedRose app = new GildedRose(items);
app.updateQuality();
return app;
}