我想知道如何在<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。
我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)