testing

Protractor - Scroll down and click

孤街醉人 提交于 2019-12-23 03:08:36
问题 I'm trying to simply scroll down in table and click on the element. This is function which I have: var scrollIntoView = function () { arguments[0].scrollIntoView(); } element.all(by.css('div.ui-grid-selection-row-header-buttons')).then(function(arr) { var row = arr[8]; browser.executeScript(scrollIntoView, row.getWebElement()).then(function () { row.click(); }); }); This script actually work and even scroll down, bproblem start when i use higher number (index) in arr[]; For example 8 work,

Multiple firefox profiles in protractor

倾然丶 夕夏残阳落幕 提交于 2019-12-23 03:07:26
问题 Following Configuring multiple capabilities with promises topic. Use case: I have two separate tests that require Firefox to be fired with javascript disabled and local storage disabled . Which means that I need two firefox profiles with javascript.enabled = false and dom.storage.enabled = false desired capabilities/preferences set. I'm using getMultiCapabilities() that was introduced in protractor 1.6. Till this moment, I needed only one custom firefox profile and it worked, here is the

How do I test that all my expected web.config settings have been defined?

拥有回忆 提交于 2019-12-23 02:57:20
问题 I am using the built in test framework in VS2008 and I would like be able to write a test that makes sure all the expected web.config settings have been defined so that if by accident one is removed or changed my suite of tests will detect it and not have to be tested in a runtime scenario. How would I set this up? I do not want to setup a mockup of my web.config since I don't want to maintain two versions and this would make my test invalid anyways since I am really trying to capture the

Testing function within same file is called

我只是一个虾纸丫 提交于 2019-12-23 02:55:07
问题 I have 2 functions where one calls the other and the other returns something, but I cannot get the test to work. Using expect(x).toHaveBeenCalledWith(someParams); expects a spy to be used, but I am unaware of how to spy on a function within the same file... Error: : Expected a spy, but got Function. Usage: expect().toHaveBeenCalledWith(...arguments) Example.ts doSomething(word: string) { if (word === 'hello') { return this.somethingElse(1); } return; } somethingElse(num: number) { var x = {

JUnit: Run one test with different configurations

情到浓时终转凉″ 提交于 2019-12-23 02:48:27
问题 I have 2 test methods, and i need to run them with different configurations myTest() { ..... ..... } @Test myTest_c1() { setConf1(); myTest(); } @Test myTest_c2() { setConf2(); myTest(); } //------------------ nextTest() { ..... ..... } @Test nextTest_c1() { setConf1(); nextTest(); } @Test nextTest_c2() { setConf2(); nextTest(); } I cannot run them both from one config (as in code below) because i need separate methods for tosca execution. @Test tests_c1() { setConf1(); myTest() nextTest(); }

what browsers are vulnerable for multiple x-frame-options

久未见 提交于 2019-12-23 02:48:12
问题 I'm Doing a web app testing and found some vulnerability on having the Multiple x-frame-options header entries. What browsers are vulnerable for multiple x-frame-options? What are the attacks possible for the Multiple x-frame-options header entries? ClickJacking seems to be a hard approach since this is not possible with the newer browsers. 回答1: According to RFC7034 [1], it is allowed to set multiple message-headers with the same name. When such message-headers are present, they are usually

protractor: testing bootstrap alerts

不问归期 提交于 2019-12-23 02:31:38
问题 I'm new to Protractor testing. Been at it for only a few hours. I have an angular app, using bootstrap alerts. How do I test: Alert (danger-alert) is not present on page load Alert (danger-alert) becomes present on button click Alert (success-alert) becomes present on another button click Thanks! 回答1: Alert (danger-alert) is not present on page load You can use isPresent(): expect(element(by.css('.alert-danger')).isPresent()).toBe(false); Or, if the element is there but invisible, check

pitest doesn't find tests

人走茶凉 提交于 2019-12-23 02:25:22
问题 I am facing a problem with the SonarQube project. I want to calculate some statistics about test quality and I am using pitest. Unfortunately, it doesn't find any test to mutate. This is the pom.xml of the module that I am analyzing: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0

What is the easiest way using .net to check if events have been logged in the eventlog?

天涯浪子 提交于 2019-12-23 02:17:08
问题 What is the easiest way to check if events have been logged in the eventlog during a period of time? I want to perform a series of automated test steps and then check if any errors were logged to the Application Event Log, ignoring a few sources that I'm not interested in. I can use System.Diagnostics.EventLog and then look at the Entries collection, but it doesn't seem very useable for this scenario. For instance Entries.Count can get smaller over time if the event log is removing old

What is the easiest way using .net to check if events have been logged in the eventlog?

喜欢而已 提交于 2019-12-23 02:17:07
问题 What is the easiest way to check if events have been logged in the eventlog during a period of time? I want to perform a series of automated test steps and then check if any errors were logged to the Application Event Log, ignoring a few sources that I'm not interested in. I can use System.Diagnostics.EventLog and then look at the Entries collection, but it doesn't seem very useable for this scenario. For instance Entries.Count can get smaller over time if the event log is removing old