Skip to content

Instantly share code, notes, and snippets.

View simple-elf's full-sized avatar
🏠
Working from home

Anton Aftakhov simple-elf

🏠
Working from home
View GitHub Profile
@simple-elf
simple-elf / Скрипт для взаимодействия пользователя с колонкой. Home Assistant. Яндекс колонка. Диалог. Скрипт для взаимодействия пользователя с колонкой.
# Скрипт создан AlexOwl. Страница автора https://gist.github.com/AlexOwl
# Чтобы скрипт работал, обязательно создаем вспомогательный элемент "текст" и создаем с именем "yandex_station_dialog_tag"
alias: Яндекс колонка. Диалог
mode: single
variables:
yandex_station_entity: здесь указываем либо переменную последней активной колонки '{{ states.input_text.active_station.state }}' либо конкретную колонку media_player.yandex_station_00000000000000000000
dialog_tag_entity: input_text.yandex_station_dialog_tag
fields:
message:
@simple-elf
simple-elf / yandex_station_telegram_automation.yaml
Created January 20, 2023 18:09 — forked from AlexxIT/yandex_station_telegram_automation.yaml
Команды через Telegram на разные станции
automation:
- trigger:
platform: event
event_type: yandex_station_response
action:
service: telegram_bot.send_message
data_template:
target: "{{ trigger.event.data.request_id }}"
message: "{{ trigger.event.data.text }}"
Starting ChromeDriver 109.0.5414.74 (e7c5703604daa9cc128ccf5a5d3e993513758913-refs/branch-heads/5414@{#1172}) on port 59975
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
янв 13, 2023 3:04:40 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected upstream dialect: W3C
янв 13, 2023 3:04:40 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find an exact match for CDP version 109, so returning the closest version found: a no-op implementation
янв 13, 2023 3:04:40 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Unable to find CDP implementation matching 109.
@simple-elf
simple-elf / parameterizedTest.java
Created July 28, 2021 06:05
Allure TestOps junit5 ParameterizedTest
@ParameterizedTest(name = "{displayName}[{0} {1} {2}]")
@DisplayName("Выполнение запроса без отправки токена")
@MethodSource("allMethodProvider")
void noTokenTest(String method, String endpoint, ContentType contentType) {
Allure.parameter("method", method);
Allure.parameter("endpoint", endpoint);
Allure.parameter("contentType", contentType);
// OR Allure.label("TMS", testCaseId)
}
Logger: aiohttp.server
Source: /usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py:393
First occurred: 23:18:51 (1 occurrences)
Last logged: 23:18:51
Unhandled exception
Traceback (most recent call last):
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1152, in _sendfile_fallback
read = await self.run_in_executor(None, file.readinto, view)
asyncio.exceptions.CancelledError
private void setPassword(SelenideElement passInput, String password) {
step("Ввод пароля: ******");
RemoveAllureSelenideListener(); // hack
passInput.shouldBe(visible).setValue(password).shouldHave(value(password));
AllureSelenideListener(); // hack
}
public static void AllureSelenideListener() {
SelenideLogger.addListener("AllureSelenide", new AllureSelenide()
.savePageSource(true)
pipeline {
agent {
label 'master'
}
stages {
stage('Checkout') {
//////
}
import static io.qameta.allure.Allure.step;
import static org.junit.jupiter.api.Assertions.fail;
import io.qameta.allure.Step;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class IncludedStepsTest {
#!/usr/bin/env bash
# Apache License Version 2.0, January 2004
# https://github.com/aerokube/cm/blob/master/LICENSE
set -e +o pipefail
b="\033[0;36m"
g="\033[0;32m"
r="\033[0;31m"
public class ProductsPage {
private SelenideElement root = $(By.xpath(".//div[some path]"))
public Product getProducts(){
List<Product> products = new ArrayList<>();
root.forEach(p -> products.add(new Product(p)));
return products;
}
}