public void TestGetelementAttributeAndSetAVariableUsingSlim() { /* * This test is importatnt because it saves a value to "variable", later on in another test there will be a Fixture.Recall(variable) will will * replace the variable value for a new one. */ TestManager.InCompareData = false; FireFoxSlimFixture testFixture = new FireFoxSlimFixture(); //<table><tr><td>SWATFixture</td></tr><tr><td>OpenBrowser</td></tr><tr><td>NavigateBrowser</td><td>file:///C:/SWAT/trunk/SWAT.Tests/TestPages/TestPage.htm</td></tr><tr><td>GetElementAttribute</td><td>Expression</td><td>id:dd</td><td>innerHTML</td><td>variable</td><td>a</td></tr><tr><td>CloseBrowser</td> </tr></table> List<List<string>> testTable = new List<List<string>>(); testTable.Add(new List<string> { "OpenBrowser" }); testTable.Add(new List<string> { "NavigateBrowser", "file:///C:/SWAT/trunk/SWAT.Tests/TestPages/TestPage.htm" }); testTable.Add(new List<string> { "GetElementAttribute", "Expression", "id:dd", "innerHTML", "variable", "a" }); testTable.Add(new List<string> { "CloseBrowser" }); List<object> list = testFixture.DoTable(testTable); Assert.IsTrue(TablePasses(list)); }
public void TestFitnesseWithInverserModifierUsingSlim() { FireFoxSlimFixture testFixture = new FireFoxSlimFixture(); //<table><tr><td>SWATFixture</td></tr> <tr><td>OpenBrowser</td></tr><tr><td>NavigateBrowser</td><td>file:///C:/SWAT/trunk/SWAT.Tests/TestPages/TestPage.htm</td></tr><tr><td><>GetElementAttribute</td><td>Expression</td><td>id:IDontExist</td><td>variable</td><td>a</td></tr><tr><td>CloseBrowser</td></tr></table> List<List<string>> testTable = new List<List<string>>(); testTable.Add(new List<string> { "OpenBrowser" }); testTable.Add(new List<string> { "NavigateBrowser", "file:///C:/SWAT/trunk/SWAT.Tests/TestPages/TestPage.htm" }); testTable.Add(new List<string> { "<>GetElementAttribute", "Expression", "id:IDontExist", "variable", "a" }); testTable.Add(new List<string> { "CloseBrowser" }); List<object> list = testFixture.DoTable(testTable); Assert.IsTrue(TablePasses(list)); }
public void TestDisplayVariableCorrectlyDisplaysResultUsingSlim() { FireFoxSlimFixture testFixture = new FireFoxSlimFixture(); string varName = "var1"; List<List<string>> testTable = new List<List<string>>(); testTable.Add(new List<string> { "OpenBrowser" }); testTable.Add(new List<string> { "NavigateBrowser", "file:///C:/SWAT/trunk/SWAT.Tests/TestPages/TestPage.htm" }); testTable.Add(new List<string> { "GetElementAttribute", "Id", "btnSetVal", "value", varName }); testTable.Add(new List<string> { "DisplayVariable", varName }); testTable.Add(new List<string> { "CloseBrowser" }); List<object> list = testFixture.DoTable(testTable); string result = ((List<string>)list[3])[1].ToString(); int startingPos = result.LastIndexOf(":") + 1; string varValue = "Set Value"; Assert.AreEqual(varValue, result.Substring(startingPos)); }
public void TestDisplayTimerValueCorrectlyDisplaysResultUsingSlim() { FireFoxSlimFixture testFixture = new FireFoxSlimFixture(); string timerName = "timer1"; List<List<string>> testTable = new List<List<string>>(); testTable.Add(new List<string> { "StartTimer", timerName }); testTable.Add(new List<string> { "Sleep", "1500" }); testTable.Add(new List<string> { "DisplayTimerValue", timerName }); List<object> list = testFixture.DoTable(testTable); string result = ((List<string>)list[2])[1].ToString(); int startingPos = result.LastIndexOf(":")+1; int timerValue; Assert.IsTrue(int.TryParse(result.Substring(startingPos), out timerValue)); }
public void TestGetTimerValueFailsWhenTimerDoesNotExistUsingSlim() { FireFoxSlimFixture testFixture = new FireFoxSlimFixture(); List<List<string>> testTable = new List<List<string>>(); testTable.Add(new List<string> { "GetTimerValue", "var1", "aTimer"}); List<object> list = testFixture.DoTable(testTable); Assert.IsFalse(TablePasses(list)); }
public void TestFitnesseWithMultipleColumnRealDataUsingSlim() { FireFoxSlimFixture testFixture = new FireFoxSlimFixture(); //<table><tr><td>BeginCompareData</td></tr><tr><td>Column1</td><td>Column2</td></tr><tr><td>Data1</td><td>Data2</td></tr><tr><td>EndCompareData</td></tr></table> List<List<string>> testTable = new List<List<string>>(); testTable.Add(new List<string> { "@@ConnectToMssql", "devausql01", "dev", "usg" }); testTable.Add(new List<string> { "@@SetDatabase", "ULTIPRO_CALENDAR" }); testTable.Add(new List<string> { "@@SetQuery", "select pgrperiodcontrol from paygroup where pgrPayGroup = 'QUBW1'" }); testTable.Add(new List<string> { "@@GetDbRecordByColumnName", "varPeriodControl", "0", "pgrperiodcontrol" }); testTable.Add(new List<string> { "SetQuery", "select pgpPayGroup, PgpPeriodControl from PgPayPer where pgpPayGroup = 'QUBW1' AND PgpPeriodControl = '>>varPeriodControl<<'" }); testTable.Add(new List<string> { "BeginCompareData" }); testTable.Add(new List<string> { "pgpPayGroup", "PgpPeriodControl" }); testTable.Add(new List<string> { "QUBW1", ">>varPeriodControl<<" }); testTable.Add(new List<string> { "EndCompareData" }); testTable.Add(new List<string> { "AssertRecordCount", "1" }); List<object> list = testFixture.DoTable(testTable); Assert.IsTrue(TablePasses(list)); }
public void TestFitnesseWithMultipleColumnFakeDataUsingSlim() { FireFoxSlimFixture testFixture = new FireFoxSlimFixture(); //<table><tr><td>BeginCompareData</td></tr><tr><td>Column1</td><td>Column2</td></tr><tr><td>Data1</td><td>Data2</td></tr><tr><td>EndCompareData</td></tr></table> List<List<string>> testTable = new List<List<string>>(); testTable.Add(new List<string> { "BeginCompareData" }); testTable.Add(new List<string> { "Column1", "Column2" }); testTable.Add(new List<string> { "Data1", "Data2" }); testTable.Add(new List<string> { "EndCompareData" }); List<object> list = testFixture.DoTable(testTable); Assert.IsFalse(TablePasses(list)); }
public void TestFitnesseWithCommandThatDoesNotPassUsingSlim() { FireFoxSlimFixture testFixture = new FireFoxSlimFixture(); //<table><tr><td>SWATFixture</td></tr><tr><td>OpenBrowser</td></tr><tr><td>CloseBrowser</td></tr><tr><td><>GetElementAttribute</td><td>Expression</td><td>id:IdontExist</td><td>value</td><td>variable</td><td>a</td></tr></table> List<List<string>> testTable = new List<List<string>>(); testTable.Add(new List<string> { "OpenBrowser" }); testTable.Add(new List<string> { "CloseBrowser" }); testTable.Add(new List<string> { "GetElementAttribute", "Expression", "id:IDontExist", "value", "variable", "a" }); // <> List<object> list = testFixture.DoTable(testTable); Assert.IsFalse(TablePasses(list)); }