小编Rad*_*iac的帖子

单击 Cypress 后捕获 URL(window.location 更改)

我想知道如何在<a>链接上的点击事件后捕获和读取 URL 。

在 onClick 事件中,我们的 javascripthref对所点击链接的实际内容进行一些字符串操作,然后动态window.location.href = myNewReplacebleURL完成。原始href位置不一定是您在 onClick 之后到达的位置。

这是我开始的方式:

describe("Twitter", function() {

  it("Should assert that via value is set correctly in JS", function() {

    cy.server();
    cy.visit(Cypress.config("appUrl") + "/probes/sha/sha-via.html");
    cy.get("#v_test ul.share li a")
      .click();

  });

});
Run Code Online (Sandbox Code Playgroud)

编辑:我想要的是捕获位于“页面加载”步骤的 URL。

在此处输入图片说明

testing e2e-testing cypress

8
推荐指数
2
解决办法
8688
查看次数

来自 ngrx/store 的 Reducer 不会触发

combineReducers在一个"@angular/core": "4.4.3""@ngrx/store": "4.0.3"项目中在调度操作后我遇到了减速器没有被拾取的问题。

这可能只是我有限的经验 ngrx/store

整个项目可以在这里看到https://github.com/raduchiriac/workflow

app.module.ts

import { AppStore } from './app.store'

@NgModule({
  imports: [
    StoreModule.forRoot(AppStore),
    ...
  ],
  providers: [
    ...
  ]
})
Run Code Online (Sandbox Code Playgroud)

应用商店.ts

import { createSelector } from 'reselect';
import * as ModalsReducer from "./store/reducers/modals.reducer";

export interface AppState {
  modals: ModalsReducer.State,
}

const metaReducer: ActionReducer<AppState> = combineReducers({
  modals: ModalsReducer.reducer,
});

export function AppStore(state: any, action: any) {
  return metaReducer(state, action);
}
Run Code Online (Sandbox Code Playgroud)

modals.reducer.ts

import * as ModalsActions from '../actions/modals.actions';

export interface State …
Run Code Online (Sandbox Code Playgroud)

typescript redux angular ngrx-store

5
推荐指数
1
解决办法
3925
查看次数

标签 统计

angular ×1

cypress ×1

e2e-testing ×1

ngrx-store ×1

redux ×1

testing ×1

typescript ×1