<input type="file" class ="upload" ...
самому.'UPDATE data SET set {field} = "{val}" where uid = {uid}'.format(field, val,1)
$ git clone https://github.com/rachyandco/nym-vagrant
Cloning into 'nym-vagrant'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 9 (delta 2), reused 9 (delta 2), pack-reused 0
Unpacking objects: 100% (9/9), done.
$ cd nym-vagrant/
$ ls
README.md run.sh* Vagrantfile
$ vagrant up
==> vagrant: A new version of Vagrant is available: 2.2.7!
==> vagrant: To upgrade visit: https://www.vagrantup.com/downloads.html
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/bionic64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/bionic64'
default: URL: https://vagrantcloud.com/hashicorp/bionic64
==> default: Adding box 'hashicorp/bionic64' (v1.0.282) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/hashicorp/boxes/bionic64/versions/1.0.282/providers/virtualbox.box
default: Progress: 6% (Rate: 9.7M/s, Estimated time remaining: 0:00:59)
...
default: Downloading: https://vagrantcloud.com/hashicorp/boxes/bionic64/versions/1.0.282/providers/virtualbox.box
default:
==> default: Successfully added box 'hashicorp/bionic64' (v1.0.282) for 'virtualbox'!
==> default: Importing base box 'hashicorp/bionic64'...
...
vagrant ssh
vagrant@vagrant:~$
uname -a
Linux vagrant 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
sudo apt-get update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
0% [3 InRelease gpgv 88.7 kB]
...
ping security.ubuntu.com
PING security.ubuntu.com (91.189.88.24) 56(84) bytes of data.
64 bytes from steelix.canonical.com (91.189.88.24):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from os import getenv
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoAlertPresentException
from selenium.common.exceptions import TimeoutException
if __name__ == '__main__':
driver = webdriver.Firefox()
driver.maximize_window()
if getenv('OS') != None :
homedir = getenv('HOMEDIR').replace('\\', '/')
else:
homedir = getenv('HOME')
location = 'file:///{0}/{1}'.format('{0}/Downloads'.format(homedir),'localized_text.html')
driver.get(location)
xpath = '//div[@id="up_file_name"]/label'
expected_text = u'Ошибка: неверный формат файла'
try:
WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.XPATH, xpath)))
element = driver.find_element_by_xpath(xpath )
assert element.text.encode('utf8','ignore').decode('utf8') == expected_text
print('Verified Text of Element: "{0}"'.format(element.text.encode('utf8','ignore')) )
except ( TimeoutException) as e:
print('Element is not located: '.format(e))
print (e.args)
finally:
driver.quit()
<html>
<body>
<h1>Localized Page Demo</h1>
<div id="up_file_name" class="form-group has-error">
<label class="control-label">Ошибка: неверный формат файла</label>
<input class="file" type="hidden" name="uploaded-file" value="0" data-point="10" data-texterrortobigfile="Вы хотите загрузить слишком большой файл: пожалуйста внимательно прочитайте требования по размеру загружаемого файла." data-texterroruploadfail="Не загружено резюме">
</div>
</body>
</html>
sed -e 's/oldstuff/newstuff/g' inputFileName > outputFileName
...
ARG params
ENV params_env=$params
ENTRYPOINT ["java", "-Dparams=${params_env}", "-jar", "app.jar" ]
docker build -f Dockerfile -t basic-args-example --build-arg "params=eyJpZCI6MH0K".
ARG
а из него в ENV
и уж из него в ENTRYOINT
{"id":0}
class element_to_be_clickable(object):
""" An Expectation for checking an element is visible and enabled such that
you can click it."""
def __init__(self, locator):
self.locator = locator
def __call__(self, driver):
element = visibility_of_element_located(self.locator)(driver)
if element and element.is_enabled():
return element
else:
return False
class visibility_of_element_located(object):
""" An expectation for checking that an element is present on the DOM of a
page and visible. Visibility means that the element is not only displayed
but also has a height and width that is greater than 0.
locator - used to find the element
returns the WebElement once it is located and visible
"""
def __init__(self, locator):
self.locator = locator
def __call__(self, driver):
try:
return _element_if_visible(_find_element(driver, self.locator))
except StaleElementReferenceException:
return False
# based on examples from https://docs.microsoft.com/en-us/dotnet/api/system.consolekey?view=netframework-4.5
function WriteAt {
param(
[string] $s,
[int] $x,
[int] $y
)
[System.Console]::SetCursorPosition($origCol + $x, $origRow + $y )
[System.Console]::Write($s)
}
[System.Console]::Clear( )
$origRow = [System.Console]::CursorTop;
$origCol = [System.Console]::CursorLeft;
# Draw the left side of a 5x5 rectangle, from top to bottom.
WriteAt '+' 0 0
WriteAt '|' 0 1
WriteAt '|' 0 2
WriteAt '|' 0 3
WriteAt '+' 0 4
# Draw the bottom side, from left to right.
WriteAt '---' 1 4
# Draw the right side, from bottom to top.
WriteAt '|' 4 3
WriteAt '|' 4 2
WriteAt '|' 4 1
WriteAt '+' 4 0
# Draw the top side, from right to left.
WriteAt '---', 1 0
WriteAt 'Press Enter to quit!' 0 6
[System.Console]::WriteLine( )
while ([System.Console]::ReadKey().Key -ne [System.ConsoleKey]::Enter) {
sleep 1;
}