Add e2e tests and remove unused variable in directive