Skip to content

Instantly share code, notes, and snippets.

View yashaka's full-sized avatar

Iakiv Kramarenko yashaka

View GitHub Profile
@yashaka
yashaka / selenide_in_15_minutes_demo.py
Last active September 17, 2015 10:06
Notes from demo "Selenide in 15 minutes (in Python)" - version with waiting implemented from scratch and conditions as lambdas [ demoed in Minsk on 01.08.2015 ]
import contextlib
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import stopit
import time
browser = webdriver.Firefox()
@yashaka
yashaka / selenide_in_less_than_15_minutes_demo.py
Last active September 10, 2015 07:52
Notes from demo "Selenide in less than 15 minutes (in Python)" - version based on Selenium explicit waiters and expected conditions demoed in Minsk on 01.08.2015 ]
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait
browser = webdriver.Firefox()
class WaitingElement(object):
def __init__(self, css_selector):
@yashaka
yashaka / tasj-course-lesson-5-0-tiny-review-of-e2e-impl.txt
Created October 25, 2015 15:01
Tasj course lesson 5-0 - Tiny Review of E2E Implementation - notes_
***
- "task 1" = active task
+ "task 2" = comleted task
All filter
- "a"
- "b"
+ "c"
@yashaka
yashaka / tasj-course-lesson-5-1-e2e-vs-one-feature-tests.txt
Created October 25, 2015 15:14
Tasj course lesson 5-1 - End to End tests vs One Feature Tests - notes_
***
Did the prototype/proof of concept:
Smoke Coverage:
- main: End to End scenario
- additional: Feature Tests ( = 1 feature per test method, or "unit style" tests)
- 6s total time execution
What next?
Full Coverage:
@yashaka
yashaka / tasj-course-lesson-5-2-implementing-precondition-helpers-hints.txt
Created October 25, 2015 15:39
Tasj course lesson 5-2 - Implementing Precondition-helpers - Hints. Wait for JS on page load - notes_
*** Given impl hints
JS example:
localStorage.setItem("todos-troopjs", "[{\"completed\":true, \"title\":\"new\"}]")
Interface:
givenAllActive("a", "b", "c")
givenAllCompleted("a", "b", "c")
given(true, "a", "b", "c")
@yashaka
yashaka / tasj-course-lesson-6-1-java-class-toolkit-static-non-static.java
Last active November 1, 2015 15:10
Tasj course lesson - 6-1 - Java Class Toolkit - Static and Non-static members.txt
/**************
* Human.java *
**************/
package com.tasj.lesson6.class_toolkit.entities;
public class Human {
public static int canDriveAge = 16;
@yashaka
yashaka / rest-server-explained.py
Created April 3, 2016 20:40
Краткое введение в Python для немножко знающих java на примере кода REST веб сервиса на Python + Flask описанного в статье https://habrahabr.ru/post/246699/
#!flask/bin/python
# предыдущая строка
# - это такой способ в скриптах (не только в пайтон) обозначить что именно это за скрипт:)
# ... в нашем случае - пайтон скрипт :)
# Предисловие :)
# Лучше всего читать этот код параллельно с оригинальной статьей:
# Проектирование RESTful API с помощью Python и Flask
# на https://habrahabr.ru/post/246699/
Хм... Сложно согласиться с
> в Haskell монады -- это способ записать _императивный_ код в полностью декларативном языке.
Наверное если смотреть технически - то это верное высказывание.
Но оно скрывает суть. Скрывает смысл "пользы от монад".
Насколько я помню...
Монады - они и в Африке монады. В независимости от того какой язык - чисто декларативный/функциональный или нет.
> Encapsulation cannot ensure that some behavior is stable to a contract.
> If you want to ensure that the behavior is stable to a contract
> you need property-based testing and test the behavior.
> Forbidding access to internal members means you end up with a tightly coupled system.
> Read: http://mergeconflict.com/coupling-in-object-oriented-programming/
Yes, encapsulation cannot ensure that some behaviour is stable. But nobody said it should.
It should ensure that "internal structure" is hidden and so "effectively" stable for the client.
@yashaka
yashaka / selenide-main-features.md
Created August 9, 2016 09:42
What Selenide gives you over Selenium?

Did you try/hear about Selenide (http://selenide.org/)?

It's pretty simple wrapper, that gives you a "lazy proxy" version of WebElement (SelenideElement), so you don't need to use all these bulky and limiting agility @FindBy-s.

It also gives more "readable" explicit waits of style:

element.shouldHave(text("foo"));

over Selenium's: