renamed the ids, removed the replace_all parameter and changed the name of the testcase as mentioned in the comments

pull/3630/head
arovitn 8 years ago
parent 33c1dea080
commit b22994eb47

@ -163,7 +163,7 @@ define([
var allCellsButton = $('<button/>')
.append($('<i/>').addClass('fa fa-arrows-v'))
.attr('id', 'allcells_id')
.attr('id', 'findreplace_allcells_btn')
.attr('type', 'button')
.addClass("btn btn-default btn-sm")
.attr('data-toggle','button')
@ -180,7 +180,7 @@ define([
var search = $("<input/>")
.addClass('form-control input-sm')
.attr('id', 'input_id')
.attr('id', 'findreplace_find_inp')
.attr('placeholder',i18n.msg._('Find'));
var findFormGroup = $('<div/>').addClass('form-group');
@ -196,7 +196,7 @@ define([
)
var replace = $("<input/>")
.attr('id', 'replace_id')
.attr('id', 'findreplace_replace_inp')
.addClass('form-control input-sm')
.attr('placeholder',i18n.msg._('Replace'));
var replaceFormGroup = $('<div/>').addClass('form-group');
@ -358,7 +358,7 @@ define([
buttons:{
'Replace All':{ class: "btn-primary",
click: function(event){onsubmit(event); return true;},
id: "replaceall_id",
id: "findreplace_replaceall_btn",
}
},
open: function(){

@ -1,8 +1,7 @@
import os
import pytest
def test_find_and_replace_apply_all(notebook):
def test_find_and_replace(notebook):
""" test find and replace on all the cells """
cell_0, cell_1, cell_2, cell_3 = "hello", "hellohello", "abc", "ello"
@ -16,7 +15,7 @@ def test_find_and_replace_apply_all(notebook):
notebook.add_cell(index=3, content=cell_3);
# replace the strings
notebook.find_and_replace(index=0, find_txt=find_str, replace_txt=replace_str, replace_all=True)
notebook.find_and_replace(index=0, find_txt=find_str, replace_txt=replace_str)
# check content of the cells
assert notebook.get_cell_contents(0) == cell_0.replace(find_str, replace_str)

@ -100,15 +100,15 @@ class Notebook:
self.to_command_mode()
self.current_cell = cell
def find_and_replace(self, index=0, find_txt='', replace_txt='', replace_all=False):
def find_and_replace(self, index=0, find_txt='', replace_txt=''):
self.focus_cell(index)
self.to_command_mode()
self.body.send_keys('f')
wait_for_selector(self.browser, "#find-and-replace", single=True)
self.browser.find_element_by_id("allcells_id").click()
self.browser.find_element_by_id("input_id").send_keys(find_txt)
self.browser.find_element_by_id("replace_id").send_keys(replace_txt)
self.browser.find_element_by_id("replaceall_id").click()
self.browser.find_element_by_id("findreplace_allcells_btn").click()
self.browser.find_element_by_id("findreplace_find_inp").send_keys(find_txt)
self.browser.find_element_by_id("findreplace_replace_inp").send_keys(replace_txt)
self.browser.find_element_by_id("findreplace_replaceall_btn").click()
def convert_cell_type(self, index=0, cell_type="code"):
# TODO add check to see if it is already present

Loading…
Cancel
Save