class LoginView:
def __init__(self):
self.viewname='ABC'
def enter(self):
tf.executeApiCall()
def wait_for_view(self):
tf.wait_for_view(self.viewname)
def press_cancel_button(self):
tf.press_widget('xyz.ABC')
def enter_username(self, u):
tf.enter_string('xyz.ABC.inputfield', u)
def check_error_popup_visible(self,expect):
if expect==True:
tf.wait_for_view(view='xyz.ABC.LoginErrorPopup')
else:
tf.wait_for_view(notinview='xyz.ABC.LoginErrorPopup')
def press_login_button(self):
tf.press_widget('xyz.ABC.Login')
username='Kolya'
main_view = MainView()
login_view = LoginView()
login_view.enter()
login_view.wait_for_view()
login_view.enter_username(u=username)
login_view.press_login_button()
login_view.check_error_popup_visible(expect=True)
login_view.confirm_error_popup()
login_view.check_error_popup_visible(expect=False)
login_view.check_inputfield_text_equals(expect=username)
login_view.leave()
main_view.wait_for_view()
a = [12,35,49]
bracket = 3;
result = []
for x in a:
for i in range(-bracket,bracket+1):
result.append(x+i);
print result
items = [12,35,49]
bracket = 3
result = sum(list(map(lambda x: range(x-bracket,x+bracket+1), items)),[])
print result
class Main {
public static void main(String[] args) {
Dog[] pets;
pets = new Dog[7];
}
}
class Dog{}
class Main {
public static void main(String[] args) {
Phone p = new MyPhone();
p.sayHello();
}
}
class Phone{
void sayHello(){System.out.println("Hello Phone");}
}
class MyPhone extends Phone{
void sayHello(){System.out.println("Hello MyPhone");}
}
<form action="demo_form.asp" onsubmit="myFunction()">
<input type='hidden' name='mess' id='mess'>
<div name='mess_s' id='mess_s' class='f_ot' contenteditable='true'>blabla</div>
Enter name: <input type="text" name="fname">
<input type="submit" value="Submit">
</form>
<script>
function myFunction() {
document.getElementById('mess').value=document.getElementById('mess_s').innerHTML;
document.getElementById('mess_s').innerHTML = '';
}